text:
Q: Print all possible choices from 1 to x Is there a way to print all the possible choices of 1 to x where there are no repeated numbers and for variable amount of numbers?
So basically if x = 10, and n (the length of the list) = 5
[1,2,3,4,5],  [1,2,3,4,6]...
[2,1,3,4,5]...
[10,9,8,7,6]

Where the order of producing these lists doesn't matter, so the second list in the example could be printed last if it is convinient

EDIT
What I have tried so far, but it isn't easy to change
    for (int a = 1; a < x; a++) {
        Set<Integer> data = new HashSet<>();
        data.add(a);

        for (int b = 1; b < x; b++) {
            if(data.contains(b)) continue;
            data.add(b);
            for (int c = 1; c < x; c++) {
                if(data.contains(c)) continue;
                data.add(c);
                for (int d = 1; d < x; d++) {
                    if(data.contains(d)) continue;
                    data.add(d);
                    for (int e = 1; e < x; e++) {
                        if(data.contains(d)) continue;
                        //code
                    }
                }
            }
        }

A: Here's some code that finds all the possible selections without relying on storing the previously generated selection and checking if you have already output them:
public static void permuteArray(int[] array, int start) {
    if (array.length == start) {
         System.out.println(Arrays.toString(array));
    } else {
        for (int i = start; i < array.length; i++) {
            int temp = array[i];
            array[i] = array[start];
            array[start] = temp;
            permuteArray(array, start + 1);
            temp = array[i];
            array[i] = array[start];
            array[start] = temp;
        }
    }
}
public static void makeCombinations(int[] array, int startElement, int minValue, int maxValue, int length, boolean permute)
{
    // iterate through all values from minValue to maxValue minus the remaining spaces
    int remainingSpacesAfterThisOne = (length - 1) - startElement;
    for(int i = minValue; i <= (maxValue - remainingSpacesAfterThisOne); i++)
    {
        array[startElement] = i;
        if(startElement < (length - 1))
           makeCombinations(array, startElement + 1, i + 1, maxValue, length, permute);
        else
        {
            if(permute)
                // print out all permutations of this array:
                permuteArray(array, 0);
            else
                // print out the combination
                System.out.println(Arrays.toString(array));
        }
    }
}

public static void makeCombinations(int max, int length, boolean permute)
{
    int[] array = new int[length];
    makeCombinations(array, 0, 1, max, length, permute);
}

public static void main (String[] args)
{
    makeCombinations(10, 5, true);
}

The code generates all possible selections of length non-repeating numbers where the numbers in the selection are in ascending order, and optionally finds all the possible permutations of those selections.
If you have a max value of 10 and a length of 5, and your selection is in ascending order, then for the first item you can only choose a number from 1 to 6 inclusive (or else you won't have enough numbers to fill out the rest of the selection without repeating one or going out of ascending order). So the algorithm iterates over the possible legal values for the first item, then for each value recursively generates the possible selections that can make up the remainder of the list, enforcing ascending order by passing in the first value plus one as the min value.
Once there are no more values to generate, recursion stops and then the ascending-order selection can be permuted using a simple recursive permutation function to find all possible orderings.

A: It looks like you have a solution.  Now you just need to be able to handle arbitrary values of n.  What if instead of having n variables a,b,c,... you stored those values in an Array[n]?  Could you simulate having n loops?

A: The code I came up with on Adam's suggestion
    int[] array = new int[len];
    Arrays.fill(array, 1);

    while(array[0] < X) {
        System.out.println(Arrays.toString(array));

        //CODE

        array[len-1]++;
        for(int a = len-1; a > 0; a--) {
            for(int b = a-1; b >= 0;) {
                if(array[a] == array[b]) {
                    array[a]++;
                } else b--;

            }

            if(array[a] >= X) {
                array[a] = 1;
                array[a-1]++;
            }
        }


text:
Q: display prompt before closing the window I am facing some issues with the alert window being displayed. What I want is to display alert window and then based upon user's input I need to perform some action. But the problem I am facing is that I receive null as return value from the function.
PS: I am using Jquery msgbox v1.0 for alerts.
Here is the calling function code block -
var retVal = "No"; //don't save
    if($(this).parent().parent().hasClass("modified")){
        retVal = showPrompt();//Null returned
    }
    alert(retVal);
    switch (retVal) {
    case "Yes":
        //show download xml file on machine.
        removeWorkspace(this);
        break;
    case "No":
        removeWorkspace(this);
        break;
    case "Cancel":
        //don't do anything
        break;
    }
    event.stopPropagation();
});

Called Function:
function showPrompt(){
var resultVar = null;
$.msgBox({
    title: "Are you sure",
    content: "Do you want to save your work?",
    type: "confirm",
    buttons: [{ type:"submit", value: "Yes"},
            {type: "submit", value: "No"},
            {type: "cancel", value: "Cancel"}]
}, function(result){
    resultVar = result;
});

    return resultVar;

}

Thanks in advance.

A: In your showPrompt() function, resultVar is getting its value from a callback, but the function is being returned immediately, before that callback is executed, which is why resultVar is still null when showPrompt() returns.
Instead of trying to run the switch the way it is, why not move it to another function that is called from inside the callback?
var retVal = "No"; //don't save
var that = this;
if($(this).parent().parent().hasClass("modified")){
    showPrompt();
} else {
    methodWithSwitch(retVal);
}
event.stopPropagation();

function methodWithSwitch(val) {
    alert(val);
    switch (val) {
    case "Yes":
        //show download xml file on machine.
        removeWorkspace(that);
        break;
    case "No":
        removeWorkspace(that);
        break;
    case "Cancel":
        //don't do anything
        break;
    }
}

function showPrompt(){
    $.msgBox({
        title: "Are you sure",
        content: "Do you want to save your work?",
        type: "confirm",
        buttons: [{ type:"submit", value: "Yes"},
                {type: "submit", value: "No"},
                {type: "cancel", value: "Cancel"}]
    }, function(result){
        methodWithSwitch(result);
    });
}

A: msgBox does not behave as alert or confirm : when called, it does not suspend the current execution thread.
Your function returns before the user has clicked on any button.
The simplest way to fix this would be to call your removeWorkspace function from the "success" callback :
function showPrompt(ws){
    $.msgBox({
        title: "Are you sure",
        content: "Do you want to save your work?",
        type: "confirm",
        buttons: [{ type:"submit", value: "Yes"},
                  {type: "submit", value: "No"},
                  {type: "cancel", value: "Cancel"}]
    , success: function(result){
        switch result {
            case "Yes" :
                removeWorkspace(ws);
                break;
            case "No" :
                removeWorkspace(ws);
                break;
        }
    }});
}

// change the calling site :
if($(this).parent().parent().hasClass("modified")){
    showPrompt(this);
} else {
    // default action :
    removeWorkspace(this);
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: What would be the level curves of the complex exponential function $e^z$? So by definition, let $z = x + iy$, $e^z = e^x \cos y + i e^x \sin y$.
Then we set $e^x \cos y $ and $e^x \sin y$ to be constant,
what would be the level curves for those two functions.
(I tried to graph those function in GeoGebra, but it didn't make much sense to me)
This is an exercise problem from Gamelin's complex analysis at page 61.
Also what would be the level curves for the function $e^{\alpha z}$ where $\alpha$ is a complex number?

A: You can easily draw the level curves of the real and imaginary parts of $e^{x+iy}$. Have a look here and  here.


text:
Q: Android O - confused of definiton of Implicit Intent and Explicit Intent Basically, it's clear to distinguish implicit and explicit intent

Explicit Intents have specified a component (via
  setComponent(ComponentName) or setClass(Context, Class)), which
  provides the exact class to be run. Often these will not include any
  other information, simply being a way for an application to launch
  various internal activities it has as the user interacts with the
  application.
Implicit Intents have not specified a component; instead, they must
  include enough information for the system to determine which of the
  available components is best to run for that intent.

But I'm confused by Google's introduced on https://developer.android.com/about/versions/oreo/background.html#broadcasts

For example, ACTION_PACKAGE_REPLACED is an implicit broadcast, since
  it is sent to all registered listeners, letting them know that some
  package on the device was replaced. However,
  ACTION_MY_PACKAGE_REPLACED is not an implicit broadcast, since it is
  sent only to the app whose package was replaced, no matter how many
  other apps have registered listeners for that broadcast.

Why ACTION_MY_PACKAGE_REPLACED is not an implicit broadcast?

A: ACTION_MY_PACKAGE_REPLACED is a intent that is broadcasted ONLY to your application, since it is only triggered when YOUR application is replaced. This makes it a explicit Intent and as such is not subject to the limitation to android O.
However ACTION_PACKAGE_REPLACED is sent to every app whenever a package gets replaced, thus it is not specific to your application. This makes is a implicit Intent and is therfore forbidden under android O's new background rules.

A:
Why ACTION_MY_PACKAGE_REPLACED is not an implicit broadcast?

Because that's how Google wrote the code that sends ACTION_MY_PACKAGE_REPLACED broadcasts. They create an explicit Intent, identifying the specific receiver to receive the broadcast. They also attach the action string, in case the receiver happens to receive multiple broadcasts and needs to distinguish one from another. An explicit Intent is welcome to have an action string. The distinction between implicit and explicit Intents is whether the Intent identifies the component or not.


text:
Q: How to fix upgrade to SonarQube 5? The upgrade from SonarQube 4.0 to 5.0.1 fails during the database upgrade. I followed these instructions, but the setup does not complete:
    ### Error updating database.  Cause:         java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SONAR.RULES_REPO_KEY) violated

    ### The error may involve org.sonar.core.rule.RuleMapper.insert-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into rules           (plugin_rule_key, plugin_name,         description, description_format, status, name, plugin_config_key, priority,     is_template, language, template_id,     characteristic_id, default_characteristic_id, remediation_function, default_remediation_function,     remediation_coeff, default_remediation_coeff, remediation_offset, default_remediation_offset,     effort_to_fix_description, tags, system_tags, note_data, note_user_login, note_created_at, note_updated_at,     created_at, updated_at)         values (?, ?, ?, ?, ?, ?, ?,     ?, ?, ?, ?,     ?, ?, ?, ?,     ?, ?, ?, ?,     ?, ?, ?, ?, ?, ?,     ?, ?, ?)
    ### Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SONAR.RULES_REPO_KEY) violated
    org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
    org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:154)
    org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:141)
    org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51)
    org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
    com.sun.proxy.$Proxy79.insert(Unknown Source)
    org.sonar.server.rule.db.RuleDao.doInsert(RuleDao.java:58)
    org.sonar.server.rule.db.RuleDao.doInsert(RuleDao.java:36)
    org.sonar.server.db.BaseDao.insert(BaseDao.java:243)
    org.sonar.server.db.BaseDao.insert(BaseDao.java:218)
    org.sonar.server.rule.RegisterRules.createRuleDto(RegisterRules.java:224)
    org.sonar.server.rule.RegisterRules.registerRule(RegisterRules.java:130)
    org.sonar.server.rule.RegisterRules.start(RegisterRules.java:106)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:483)
    org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
    org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
    org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
    org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
    org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
    org.picocontainer.behaviors.Stored.start(Stored.java:110)
    org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
    org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
    org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
    org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
    org.sonar.server.platform.ServerComponents$1.doPrivileged(ServerComponents.java:665)
    org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:43)
    org.sonar.server.platform.ServerComponents.executeStartupTasks(ServerComponents.java:661)
    org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:126)
    org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:122)
    org.sonar.server.platform.Platform.doStart(Platform.java:81)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:483)
    org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:440)
    org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:304)
    org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:52)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384)
    org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:336)
    org.jruby.runtime.BlockBody.call(BlockBody.java:73)
    org.jruby.runtime.Block.call(Block.java:101)
    org.jruby.RubyProc.call(RubyProc.java:290)
    org.jruby.RubyProc.call(RubyProc.java:228)
    org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:97)
    java.lang.Thread.run(Thread.java:745)

I hope I upgraded the plugins correctly: edit: ... but I didn't.
    -rwx------+ 1 pwillems       Domain Users 1366553 Nov 12  2012 CSharpPluginsEcosystem-1.4.zip
    -rwx------+ 1 pwillems       Domain Users     105 Mar  5 13:53 README.txt
    drwx------+ 1 Administrators Domain Users       0 Mar  6 12:41 findbugs-2.0.1
    -rwx------+ 1 pwillems       Domain Users   29436 Jul 12  2012 findbugs-ant.jar
    drwx------+ 1 pwillems       Domain Users       0 Mar 10 12:58 not for 4.0
    drwx------+ 1 pwillems       Domain Users       0 Mar  6 16:16 obsolete Java 2.4
    -rwx------+ 1 pwillems       Domain Users    9205 Mar  5 12:21 sonar-branding-plugin-1.0.jar
    -rwx------+ 1 Administrators Domain Users 2014901 Mar  6 11:19 sonar-checkstyle-plugin-2.2.jar
    -rwx------+ 1 Administrators Domain Users   10325 Mar  6 11:34 sonar-cobertura-plugin-1.6.3.jar
    -rwx------+ 1 pwillems       Domain Users  917316 Mar  6 09:42 sonar-csharp-plugin-3.3.jar
    -rwx------+ 1 pwillems       Domain Users    7247 Nov 28  2012 sonar-csv-export-plugin-1.3.jar
    -rwx------+ 1 pwillems       Domain Users  102668 Nov 18  2013 sonar-dotnet-fxcop-plugin-2.1.jar
    -rwx------+ 1 pwillems       Domain Users   84620 Nov 18  2013 sonar-dotnet-gallio-plugin-2.1.jar
    -rwx------+ 1 pwillems       Domain Users  624800 Nov 18  2013 sonar-dotnet-gendarme-plugin-2.1.jar
    -rwx------+ 1 pwillems       Domain Users  280291 Nov 18  2013 sonar-dotnet-ndeps-plugin-2.1.jar
    -rwx------+ 1 pwillems       Domain Users   59047 Nov 18  2013 sonar-dotnet-plugin-2.1.jar
    -rwx------+ 1 Administrators Domain Users 1012812 Mar  6 11:37 sonar-issues-report-plugin-1.3.jar
    -rwx------+ 1 Administrators Domain Users 2468589 Mar  6 11:04 sonar-java-plugin-3.0.jar
    -rwx------+ 1 pwillems       Domain Users   30646 Feb  4  2014 sonar-ldap-plugin-1.4.jar
    -rwx------+ 1 pwillems       Domain Users  857763 Sep 16 13:08 sonar-plsql-plugin-2.6.jar
    -rwx------+ 1 Administrators Domain Users 3568440 Mar  6 11:20 sonar-pmd-plugin-2.3.jar
    drwx------+ 1 Administrators Domain Users       0 Mar  6 12:41 sonar-runner-2.0
    -rwx------+ 1 pwillems       Domain Users   36019 Mar  6 09:42 sonar-stylecop-plugin-1.1.jar
    -rwx------+ 1 pwillems       Domain Users   26259 Mar  6 09:42 sonar-visual-studio-plugin-1.2.jar

This is the recent history in the sonar.log:
    2015.03.10 13:14:40 INFO  web[o.s.s.s.IndexSynchronizer]  Index source files
    2015.03.10 13:15:40 INFO  web[o.s.s.es.BulkIndexer]  204829 requests processed
    2015.03.10 13:16:40 INFO  web[o.s.s.es.BulkIndexer]  488960 requests processed
    2015.03.10 13:17:40 INFO  web[o.s.s.es.BulkIndexer]  769172 requests processed
    2015.03.10 13:18:41 INFO  web[o.s.s.es.BulkIndexer]  1009002 requests processed
    2015.03.10 13:19:41 INFO  web[o.s.s.es.BulkIndexer]  1302412 requests processed
    2015.03.10 13:20:41 INFO  web[o.s.s.es.BulkIndexer]  1608777 requests processed
    2015.03.10 13:21:21 INFO  web[o.s.a.u.TimeProfiler]  Load metrics...
    2015.03.10 13:21:22 INFO  web[o.s.s.s.RegisterMetrics]  Cleaning quality gate conditions
    2015.03.10 13:21:22 INFO  web[o.s.a.u.TimeProfiler]  Load metrics done: 953 ms
    2015.03.10 13:21:22 INFO  web[o.s.s.s.RegisterDebtModel]  Register technical debt model...
    2015.03.10 13:21:22 INFO  web[o.s.s.s.RegisterDebtModel]  Register technical debt model done: 78 ms
    2015.03.10 13:21:22 INFO  web[o.s.a.u.TimeProfiler]  Register rules...
    2015.03.10 13:21:35 INFO  web[o.s.a.u.TimeProfiler]  Register rules done: 12985 ms
    2015.03.10 13:21:35 ERROR web[o.s.s.ui.JRubyFacade]  Fail to upgrade database

What would be useful to investigate or try? Any help is appreciated.

A: The sonar-dotnet-*-plugins break the upgrade. They are obsolete (see outdated C# Ecosystem) and must be removed.
Figured this out when I noticed the these plugins failed the "migration" of an empty database.


text:
Q: TableViewController cells not populating with data Alright, I know I'm going to annoy someone here with my n00b-ness, so consider this a fair warning. I'm fresh-as-a-fish to Obj-C, and so what may be obvious to you most likely won't to me.
I've been following this tutorial on TableViewControllers, and I can't for the life of me get the cell titles to appear. I have cut and retailored every line of code on the site, and debugged a SIGABRT error, yet even now the data does not appear.
Here is the contents of the MasterViewController.h and /.m files, respectively:
The header file:
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <UIKit/UIKit.h>

@class DetailViewController;

@interface MasterViewController : UITableViewController <NSFetchedResultsControllerDelegate, UITableViewDelegate, UITableViewDataSource>

@property (strong, nonatomic) DetailViewController *detailViewController;

//  Create property "equations" as an instance of NSArray:
@property (strong, nonatomic) NSMutableArray *equations;

@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;

@end

The implementation file:
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "MasterViewController.h"
#import "DetailViewController.h"

@interface MasterViewController ()
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath;
@end

@implementation MasterViewController

//  Synthesize NSArray instance for equation storage:
@synthesize equations = _equations;

//  Segue linking as per DetailViewController.h/.m:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"showDetail"]) {
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    DetailViewController *destViewController = segue.destinationViewController;
    destViewController.equationName = [_equations objectAtIndex:indexPath.row];
}
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.navigationItem.leftBarButtonItem = self.editButtonItem;
    UIBarButtonItem *addButton = [[UIBarButtonItem alloc]     initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
self.navigationItem.rightBarButtonItem = addButton;
self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
self.title = @"Equations";
if (!_equations)
{
    _equations = [[NSMutableArray alloc] initWithObjects:
                  // Atomic structure equations:
                  @"Energy-Frequency Relation",
                  @"Energy-Frequency-Wavelength Relation",
                  @"Energy-Quantum Number Relation",
                  @"Momentum-Mass-Frequency",
                  @"Speed of Light Definition",
                  // Equilibrium equations:
                  @"Equilibrium Acid Constant",
                  @"Equilibrium Base Constant",
                  @"Water Equilibrium Constant",
                  @"pH Calculation",
                  @"pH-Acid Constant Relation",
                  @"pOH-Base Constant Relation",
                  @"pKa Derivation",
                  @"pKb Derivation",
                  @"pOH Calculation",
                  @"Gas-pressure Equlibrium",
                  // Gas/solution chemistry equations:
                  @"Ideal-Gas Law",
                  @"Partial-pressure equation",
                  @"Total pressure (3 partials)",
                  @"mol-Molarity Calculation",
                  @"Kelvin-Celsius Relation",
                  @"Fahrenheit-Celsius Relation",
                  @"Density Calculation",
                  @"Kinetic Energy per Molecule",
                  @"Kinetic Energy per Mol",
                  @"Molarity Equation",
                  @"Molality Equation",
                  @"Absorbance Equation",
                  @"Freezing Point Depression",
                  @"Boiling Point Elevation"
                  // Redox Equations:
                  @"Electrical current definition",
                  @"Equilibrium vs. Reduction Potential",
                  // Thermochemical relations:
                  @"Change in Free Energy",
                  @"Molar Heat Capacity",
                  @"Frequency to Rate Factor",
                  nil];
    }
}
#pragma mark - Table View

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    //  Return call from NSArray *equations as to the count of elements in the table view:
    return [_equations count];
}

- (UITableViewCell *)tableView: (UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
UILabel *lblName = (UILabel *)[cell viewWithTag:100];
[lblName setText:[_equations objectAtIndex:[indexPath row]]];
return cell;
}

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return NO;
}

I spared y'all all 250 lines of code, cutting out only that seem to pertain to the view controller itself. Something tells me I'm simply leaving out a necessary line of code for connection, however my complete introductory status to the language as well as the lack of a debugger error doesn't trip me to it. Any ideas? Any help (nitpicking excluded) is more than appreciated and welcomed.

A: @"Cell"that could be a couple of things you can check here.

*

*in your cellFoRowAtIndexPaht Method
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];

//add this
if (cell == nil)
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"] autorelease];

*double check if your table data source and table delegate is connected correctly to your table view. i think when you create uitableviewcontroller from storyboard, it should connected for you automatically, but it won't harm to double check.

A: I was able to reproduce your issue as follows:
Your current tableView:cellForRowAtIndexPath: implementation requires that the cell have a UILabel subview with a tag of 100.
UILabel *lblName = (UILabel *)[cell viewWithTag:100];

The label in the cell needs to be configured with this tag...
If you are using the "Basic" cell type in Interface Builder you have two options:
Option 1
You must select the title label and set it's tag to 100.

Option 2
Change the method to directly access the text label.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    [cell.textLabel setText:_equations[indexPath.row]];
    return cell;
}

You can also use an approach similar to (if not identical to) Option 2 for custom cell types where you have provided your own label.


text:
Q: There is no function $f$ on the open unit disk, defined by a convergent power series, such that $f(1/n)=(-1)^n/n^2$
Prove that there is no function $f$ on the open unit disk, defined by a convergent power series, such that $f(1/n)=(-1)^n/n^2$.

I'm not sure how to start... any hints would be appreciated!

A: Hint: Let $g(z) = z^2$ and look at points where $f(z) = g(z)$.


text:
Q: Find $x$ for which the rank is as minimal/maximal as possible Find an $x$ in $\Bbb R$ for which rank of the matrix $$A=\begin{bmatrix}1 & 1&1&1 \\1 & -1&-1&1\\1 &-3 &-3 &x \end{bmatrix}$$
is as minimal/maximal as possible.
I was thinking of row reducing the matrix and then count the pivot.

A: The rank of the first $3$ columns is $2$ since the second column is equal to the third but the first is not a multiple of them. Thus the minimal possible rank is $2$, which is obtained by choosing $x=2$, in which case the 4th column equals the first and therefore does not increase the rank of the matrix.
On the other hand the maximal possible rank is $3$ in the case that $x$ can be choosen so that the 4th column is linearly independent of the first two columns. (The third column can be ignored since it is equal to the second and does not add to the rank of the matrix). In order to find such an $x$ you can calculate the determinant of $$A'=\begin{bmatrix}1 & 1&1 \\1 & -1&1\\1 &-3 &x \end{bmatrix}$$ and set it different from $0$. If there exists such an $x$ then the maximal rank of A is $3$ otherwise it is $2$.

Indeed $$det(A')=(-x+3)-(x-1)+(-3+1)=-x+3-x+1-3+1=-2x+2$$ where $$-2x+2\neq0 \implies x\neq 1$$ Hence for every $x\neq1$ the rank of the matrix is $3$.

A: The most general method to compute the rank is to apply the Gauss elimination algorithm:
$$A=\begin{bmatrix}1 & 1&1&1 \\1 & -1&-1&1\\1 &-3 &-3 &x \end{bmatrix}
\\\to \begin{bmatrix}1 & 1&1&1 \\0 & -2&-2&0\\0 &-4 &-4 &x-1 \end{bmatrix}
\\\to \begin{bmatrix}1 & 1&1&1 \\0 & -2&-2&0\\0 &0 &0 &x-1 \end{bmatrix}
$$
The rank is
$3$ unless $x=1$ in which case it is $2$.


text:
Q: checking and insertion of email in database using data model popup through ajax public function register()
    {

        $this->load->library('form_validation');
        $this->form_validation->set_rules('email','email','required|is_unique[register.email]');
        if($this->form_validation->run() == FALSE){

            $this->load->view('view/login_register');
            $this->session->set_flashdata('message_error','This id is already taken');

        }
        else
        {
           ///$username=$this->input->post('username');
            $email=$this->input->post('email');
            $data= array(

             ////'email'=>$this->input->post('email')
                'email'=>$email,
          //'password'=>$this->input->post('password'),
                );

            $last_id=$this->model->registeration($data);

            if ($last_id>0) {

                $this->send_email($email);

                $this->session->set_flashdata('message', 'To complete registration, click the link in email we just send you at khadija@precisetech.com.pk');
                redirect('controller/register');
            }

        }
    if(error_flag == 1){
      return false;
    }else{
      return true;
    }
  }

how to do this through Ajax if Id exist give message that id already exist, the data model popup should be there without refreshing the page and display messsage in the datamodel popup means the datmodel popup should be stay till message success or failur.


text:
Q: Error installing GLFW on mac using cabal for haskell I'm have Max OSx 10.6.8, Xcode 3.2.6 (the latest version available for my mac version). I'm using haskell but I'm having trouble using opengl.
I found a suggestion a online like the following:
cabal update
cabal install OpenGL
cabal install GLFW

My error came in the 3rd command. I got a fatal error, it says:
cabal: Error: some packages failed to install:
GLFW-0.4.2 failed during the building phase. The exception was:
ExitFailure 1

Here is the error out (there is a large amount of warnings which I'm not including for the sake of readability and space):
glfw/lib/macosx/macosx_window.c:374:0:
     error: 'typeLongInteger' undeclared (first use in this function)

glfw/lib/macosx/macosx_window.c:374:0:
     error: (Each undeclared identifier is reported only once

glfw/lib/macosx/macosx_window.c:374:0:
     error: for each function it appears in.)
glfw/lib/macosx/macosx_window.c: At top level:

glfw/lib/macosx/macosx_window.c:448:0:
     error: 'kEventWindowDrawContent' undeclared here (not in a function)
glfw/lib/macosx/macosx_window.c: In function '_glfwWindowEventHandler':

Any suggestions for how to solve it?
This is the error when I try to load a file that requires graphics:
Could not find module `Graphics.UI.GLFW':

A: Instead of using cabal, you could try downloading the glfw source tarball and build and install it from the command-line.


text:
Q: VLOOKUP/ MATCH INDEX not working when the lookup value is from a dropdown In column 'C' there are employee names and some blanks that will later have names assigned. In column 'J' there are the corresponding employees ID numbers. In column 'J' I have a MATCH/INDEX formula so that when an employees name is entered in column 'C', the other cell is also populated with the employees ID.
This was working fine until I added data validation in the form of a dependent drop down in column 'C'. After that the MATCH/INDEX works fine if you type in a value, but it returns the error #N/A if you use the drop down to select a value. I then tried using VLOOKUP but that also has the same results.
Does anybody know what I can do to solve this. So that when value from the drop down is selected the INDEX/MATCH works, without having to type it?
All this formatting is also achieved through a macro (Not sure if that makes a difference).
Heres the forumla currently in column 'J'..
=INDEX('Employee Details'!L:L,MATCH(C6,'Employee Details'!M:M,0))

Any help would be appreciated.

A: Had to retype the name values which my drop downs were referencing. Although they looked the same they were somehow different to the list of name values I was using in the INDEX/MATCH formula. After this it all worked.


text:
Q: What does the phrase 'the absolute finito' mean here? When I read the book Breakfast at Tiffany's, I encounter a sentence in the following context:

Oh, he's not my idea of the absolute finito. He tells little
  lies and he worries what people think and he takes about fifty baths a
  day: men ought to smell somewhat. He's too prim, too cautious to be my
  guy ideal; he always turns his back to get undressed and he makes too
  much noise when he eats and I don't like to see him run because
  there's something funny-looking about him when he runs. If I were free
  to choose from everybody alive, just snap my fingers and say come here
  you, I wouldn't pick José.
From Breakfast at Tiffany's by Truman Capote Page 76

What does the phrase 'the absolute finito' mean here? I have done some research that 'the absolute' can be a noun phrase which means 'something that is perfect or complete' . But what is the meaning of finito here? Is it an adjective which means 'finished'?

A: Short Answer: it is used in a way that the phrase guy ideal is used in this same passage: here, guy ideal is Holly-speak for ideal guy. DamkerngT has given an apt idiom: Mr. Right. So, yes, it means what you think: "something that is perfect or complete," although since we are talking about a person, it might be better to say "someone that is perfect or complete." The text is quoting Holly Golightly, the main character of the novella.
Longer Answer: In this passage, and the sentence previous to it, Holly is explaining why José is not her "ideal guy" or why "he's not [her] idea of the absolute finito." The sentence just previous to the text you have quoted says:

Actually, except for Doc, if you want to count Doc, José is my first non-rat romance.

So, Holly begins by saying something positive about José (saying that he is not a 'rat', an expression Holly uses throughout BAT to describe guys that are jerks or worse), but then qualifies that by saying he is not her idea of Mr Right, ideal guy, or absolute finito.
Absolute is an intensifier, which can be used with both 'positive' and 'negative' descriptions: He's an absolute dream. He's an absolute jerk.
Finito can have a neutral, positive, or negative meaning in Italian, just as finished can in English. In Italian prodotto finito can mean '"finished product" or "end product" (although I did not know that until now).

"Finito" does mean "finished" in Italian, and it means nothing more than "ended" or "over" or "done". My answer is almost finished. But in both English and apparently Italian, the word can have a negative meaning (see WordReference).  As I said earlier it can have a neutral meaning: finished or end product (Source: WordReference and my app Italian-English Dictionary). Holly is using it in a positive manner. Holly doesn't speak Italian (in BAT, her agent has given her French lessons), so it's a phrase she has either picked up from someone else or made up herself (like quel rat--literally What a rat!). Also, per Wiktionary finito is also a cognate word in Spanish and Portuguese, from Latin.
Henry, you did a great job of including a lot of context with this question. That's very important, especially when looking at a phrase that is not a standard phrase in English.
By the way, I've read Breakfast at Tiffany's (BAT or B@T) more than any other thing in print except parts of the Bible. I have read BAT probably 15 times, and half of those have been "close readings," paying close attention to every word and phrase to try to discover what author Truman Capote is actually saying, as opposed to what readers might read into the text.


text:
Q: Three linked problems : Argument 'MainCtrl' is not a function and Module 'myApp' is not available I got these three problems, which I think are linked. I read a lot of Stackoverflow posts, and Google it since 2 days, but because I'm working with the ionic creator, I didn't find a proper answer...
The curious fact is I can run and use my app except one MainCtrl function, it works, but I still have these errors messages :

Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

Error: [ng:areq] Argument 'MainCtrl' is not a function, got undefined
http://errors.angularjs.org/1.5.3/ng/areq?p0=MainCtrl&p1=not%20aNaNunction%2C%20got%20undefined

Error: [ng:areq] Argument 'LoadingCtrl' is not a function, got undefined

Here is my code, I'm sure it's a little mistake but I can't figure it out :

// Here is the module declaration

var myApp = angular.module('app.directives', []);

// The first controller's

myApp.controller('MainCtrl', ['$scope', '$ionicPopup', '$timeout', function($scope, $ionicPopup, $timeout) {

$scope.createPopUpService = function(){

var newTemplate = '
Hi
';

var myService = $ionicPopup.show({
        template: newTemplate,
        title: 'Test',
        scope: $scope,
        cssClass: 'popJoinService',
        buttons: [
              { text: 'Cancel',
                type: 'button-assertive'
              },
              {
                text: 'OK',
                type: 'button-positive',
                onTap: function(e) {
                    console.log("Hello");
                  }
              }
            ]
          });
};
}]);

// The second controller's

myApp.controller('LoadingCtrl', function($scope, $ionicLoading) {
  $scope.show = function() {
    $ionicLoading.show({
      template: 'Loading...',
      duration: 3000
    }).then(function(){
       console.log("The loading indicator is now displayed");
    });
  };
  $scope.hide = function(){
    $ionicLoading.hide().then(function(){
       console.log("The loading indicator is now hidden");
    });
  };
});
<ion-view title="HTML1" style="background-color:#93E693;">

    <ion-refresher (ionRefresh)="doRefresh($event)" ng-controller ="LoadingCtrl">
                <ion-refresher-content
                      pullingIcon="arrow-dropdown"
                      pullingText="Pull to refresh"
                      refreshingSpinner="circles"
                      refreshingText="Refreshing...">
                </ion-refresher-content>
    </ion-refresher>

      <button class="item-avatar button  button-small button-calm  button-block icon-left ion-android-add" ng-click="createPopUpService()">test button</button>

</ion-view>

A: Try it without punctuation.
var myApp = angular.module('yourAppName', []);

Try the body or html code.

or

myApp is variable and applies to Javascript.
var myApp = angular.module('yourAppName', []);
myApp.controller('MainController', function ( $scope, $rootScope ){
 //Controller code
});


text:
Q: Errors in color resources I'm getting lint errors attempting to use color resources. According to the documentation, the following should be valid.
<?xml version="1.0" encoding="utf-8"?>
<resources  xmlns:android="http://schemas.android.com/apk/res/android">
    <color name="actionbar_title"></color>
</resources>

But this gives "Attribute is missing the Android namespace prefix". Amending to
<?xml version="1.0" encoding="utf-8"?>
<resources  xmlns:android="http://schemas.android.com/apk/res/android">
    <color android:name="actionbar_title"></color>
</resources>

clears the error but in a layout file the following definition
<TextView android:id="@+id/title"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:layout_width="0dp"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="@color/actionbar_title" />

gives the error "error: Error: No resource found that matches the given name (at 'textColor' with value '@color/actionbar_title').
Any and all help will be appreciated.
EDIT:
As pointed out by type-a1pha, the above did not specify a color - I've copied from a test version. However
<?xml version="1.0" encoding="utf-8"?>
<resources  xmlns:android="http://schemas.android.com/apk/res/android">
    <color android:name="actionbar_title">#ffffff</color>
</resources>

gives the lint warning
Unexpected text found in layout file: "#ffffff"

but the color resource is still not recognised in the layout xml file.

A: You need to actually define the color:
<color name="white">#FFFFFF</color>

that is, give its hexadecimal code.

A: <color name="actionbar_title"></color>

the color is empty i see.
<color name="actionbar_title">#000000</color>

A: You should put your file under "values" folder instead of the "color" folder.


text:
Q: Integrating a Fourier series I am trying to integrate the Fourier series of $$f(x) = x,-\pi<x<\pi.$$ Using complex exponentials to find the series, I get the series $$\frac{2}{\pi} \sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n} \cdot \sin(nx).$$
Integrating will add an $n$ to the denominator and result in more rapid convergence. But when I try to integrate this series, I just end up with the series times the integral $\int_{-\pi}^{\pi}\sin(nx) \,dx$, which makes everything zero. If I integrate it termwise, I also end up with zero.
Does anybody know what mistake I am making? I am told by that integrating this, one can obtain $$\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^2} = 1 - \frac{1}{4} + \frac{1}{9}-\frac{1}{16} + ... = \frac{\pi^2}{12}.$$
Any help at all is appreciated, as I am quite flustered that this simple problem has stumped me.

A: ]if you multiply by $x$ before integrating you have:
$$
\int_{-\pi}^{\pi} x^2 dx = 2 \sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n} \cdot \int_{-\pi}^{\pi} x \sin(nx) dx
$$
which (integrated by parts) gives:
$$
\frac{2\pi^3}3 = 2 \sum_{n=1}^{\infty}\left[ (-1)^n \frac{x \cos nx}{n^2} \right]_{-\pi}^{\pi}
$$
or
$$
\sum_{n=1}^{\infty} \frac1{n^2} = \frac{\pi^2}6
$$
from this you have (given absolute convergence of the series)
$$
\sum_{n=1}^{\infty} (-1)^{n+1}\frac1{n^2} = \sum_{n=1}^{\infty} \frac1{n^2} -2 \cdot \frac14 \sum_{n=1}^{\infty} \frac1{n^2} \\
= \frac{\pi^2}{12}
$$

A: Note that
$$\left( \sum_{i=0}^\infty a_i \right)^2 \ne\sum_{i=0}^\infty a_i^2$$
You need the cauchy product to evaluate the square by integrating "term-wise".


text:
Q: Mapping Godaddy custom domain to Azure CDN endpoint I have an Azure CDN Profile with origin host name https://mysite.z8.web.core.windows.net and endpoint hostname https://mysite.azureedge.net. I would like to be able to access my static site from www.mysite.io (using GoDaddy). I am struggling with adding this mapping from my domain to the CDN endpoint. I have read through a bunch of tutorials but am still stuck.
Have I modified/added my CNAME records correctly?

A: I tested the same in my environment.
Go to your Domain Registrar --> Add a CNAME Record with Name as your subdomain and value as the azure CDN endpoint.

Open Azure Portal --> Go to your CDN Profile --> Click on the endpoint which was created for Storage Static Website --> Click on Add Custom Domain --> Enter the custom hostname as your subdomain --> Click on Add

Now you would be able to access your static website using your custom domain.


text:
Q: How to read data from a table in PDF, but the PDF also contains images? I have searched for a solution, but the examples that I have found are only for PDF's where there are no images inside the PDF file but only tables.
My question is how is it possible to read the table at the bottom right corner of a drawing(see picture) and get that data back as a table or string? I saw some people using iTextSharp, but this convert all text to a string and not the table text. I only want the tables from the PDF file/drawings being read and return as data (string or datatable).
I also used SpirePDF, but it can't read PDF files with images in it.
I tested Spire with a PDF where only tables were in and then it works.
EDIT: The table is always on the bottom right corner, but can be different in size.
Regards,
Giorgio
PDF File 1 with table on the bottom right
PDF File 2 with table on the bottom right, but a bigger table
PDF files download from Drive:
https://drive.google.com/file/d/18d9uMxBxuLQE2onrTcz2ZvM2TrkhOQHt/view?usp=sharing, https://drive.google.com/file/d/1NMNnFM2CFVv-4t9Sn6jh53dDkgkhmtI7/view?usp=sharing


text:
Q: How to get the message value of a nested exception in Python? I have an exception that looks like this:
exc = ProtocolError('Connection Aborted', BadStatusLine('No status line received'))
how can I access the No status line received part?
Here's the example situation:
def some_function():
    raise ProtocolError('Connection Aborted', BadStatusLine('No status line received'))

def some_other_function():
    try:
        some_function()
    except Exception as exc:
        if exc.message:
            details = exc.message
        else:
            details = exc

In the code above I'm trying to check if the returned exception has a message and if so I'm supposed to write it into the database, however when I call the exc.message it returns an empty string, and when I call exc it returns:

bson.errors.InvalidDocument: cannot encode object:
ProtocolError('Connection Aborted', BadStatusLine('No status linereceived',)), of type: <class 'urllib3.exceptions.ProtocolError'>

so I cant write it into the database since its a type Exception not string, what I need to do is to see if the returned Exception has another nested Exception in it and get it's message.

A: I wasn't able to find the exact optimal way to fetch the inner message or exception but for quick assistance i wrote a utility function which by using regular expressions will return you inner exceptions or messages complete code is following
from urllib3.exceptions import ProtocolError
from http.client import BadStatusLine
import re

def FetchInnerExceptions(exc):
    result = []
    messages = str(exc).split(',')
    for msg in messages:
        m = re.search('''(?<=')\s*[^']+?\s*(?=')''', msg)
        if m is not None or m != '':
            result.append(m.group().strip())
    return result

def some_function():
    raise ProtocolError('Connection Aborted', BadStatusLine('No status line received'))

def some_other_function():
    try:
        some_function()
    except Exception as exc:
        e = FetchInnerExceptions(exc)
        print(e) #dumps all array or use index e[1] for your required message

some_other_function()


text:
Q: Help understand phrase "to be engaged with one's kids in a meaningful way" I recently encountered the following paragraph:
I try hard to become incredibly selective about those
things I engage with, so I can be really present for the stuff
that I'm doing, and be really engaged with my kids in a meaningful way.

In this context, what do the phrases
things I engage with

and
to be engaged with one's kids in a meaningful way

mean?

A: See the definition for the intransitive verb here at 2.c:
http://www.merriam-webster.com/dictionary/engage?show=0&t=1413549624
To engage with means to "give your attention to {something|someone}".
To be really engaged with means to give something or someone your undivided attention.

A: It just means that he is choosing not to focus or spend time on things that aren't that important to him. Since he's not focusing on those unimportant things, he can focus on his kids, converse with them, play with them, teach them things, etc.
For example, he could have chosen to just watch TV when he gets home from work. But instead, he chooses to keep the TV turned off and hang out with his kids.


text:
Q: Updating Primary Key value Cassandra I have table with node_id, node_name and data. My requirement is to getByID and getByName. So I have made id and name as the primary keys. But I also need to sometimes update the name as well.
I know Cassandra does not allow updating primary keys and having non primary key in the WHERE clause.
How can I achieve this?
I did consider deleting the record first, and then inserting again with the same id and new name. But I read that this would create tombstones and affect the performance.

A: Use only node_id as the primary key. To implement getByName create a materialized view. materialized views in cassandra

A:     create table users_by_id_name(
        id int,
        createdOn bigint, -- timestamp in millisec
        name text,
        age int,
        primary key (id,name,createdOn)
    )WITH CLUSTERING ORDER BY ( name DESC, createdOn DESC);

Use above table definition to insert users.
Insert query --
insert into users_by_id_name (id,createdOn,name,age) values (1,100,'darthvedar',28);

to update the user, insert the row again with same user id and updated name and createdOn value.
insert into users_by_id_name (id,createdOn,name,age) values (1,200,'obi-wan-kenobi',28);

while selecting the user use below query --
select by user id -
select * from users_by_id_name where id=1 limit 1;

Select user by name -
select * from users_by_id_name where name='obi-wan-kenobi' ALLOW FILTERING;

Other way is to use secondary index on user name. Think, user name is not going to change too frequently, so secondary index is also one good option.
Edit after comments -
If you have very frequent updates on user name, it would be better to use two different tables.
   create table users_by_id(
    id int,
    name text,
    age int,
    primary key (id)
);
   create table users_by_name(
    id int,
    name text,
    age int,
    primary key (name)
);

While inserting , insert in both the tables using batch statement.
Hope this will help.


text:
Q: ¿Cómo guardo setInterval en localstorage? Tengo un sitio HTML5 fuera de línea (por ahora, para el trabajo) de vídeos que, al terminar el vídeo, setInterval, pasa a otra página de vídeo.
Lo que no puedo lograr es suspender el setInterval o el contador para que al recargar la página, quede guardado en localStorage el ajuste del botón-setInterval (que sería no contar).
Me podrían ayudar?
<button id="auto" class="auto" onclick="cancelar()">
en 10 ó cancelar
</button>

Este es el código que uso:
 var seguir = false;
 var boton = false;

 var c =

document.querySelector(".auto");
 c.addEventListener("click", cancelar);

 function cancelar() {

  if (!seguir) {

   seguir = false;
   clearInterval(yo);

//$(".auto").css({"background": "#ccc", "color": "#000"});
localStorage.setItem('boton-mode', false');
} else {

   seguir = true;

localStorage.setItem('boton-mode', true);

  };

 };

Y por supuesto, mi contador funciona bien:
// AL FINALIZAR VÍDEO
 var y = $(".yoFin");

 $("#video").on("ended", function() {

  y.show().css({"display": "flex"});
  var counter = 10;

  yo = window.setInterval( function() {

   if (counter == 0) {
window.location.href = "yo.html";
   } else {
counter = counter - 1;

document.querySelector(".counter").innerHTML = counter;
   }

  },1000);

 });

Al parecer estoy usando JavaScript puro mezclado con jQuery.

A: Aunque tu código está incompleto (le falta parte del HTML) y la pregunta es algo confusa (no se entiende muy bien lo que pretendes lograr), intentaré responder de acuerdo a lo que comprendo del problema.
PROBLEMA
Se desea almacenar un valor en el objeto localStorage, el mismo será luego capturado al momento de recargar una página o ser redirigido a otra.
La idea es mantener actualizado el estado de un botón al momento de la reproducción de un medio incrustado en la página.
SOLUCIÓN
Lo primero que debemos conocer es cómo funciona el objeto localStorage. Es muy sencillo y simple: se establece un par clave - valor usando el método setItem() y se obtiene el valor de una clave usando el método getItem().
Usando el objeto localStorage podemos almacenar el valor del estado del botón, que presumo que debe activarse sólo al momento de finalizar la reproducción del vídeo y estar activo un tiempo prudencial antes de recargar o redirigir la página.
El botón permitirá cancelar la acción automática (cancelar el setInterval) y evitar que la página se recargue. Al menos es lo que me parece que deseas lograr con este botón. Y que al momento de recargar la página manualmente, el botón guarde el último estado.
Sin saber el contenido del documento que deseas cargar o al que deseas redirigir sólo puedo suponer que es el mismo documento (yo.html).
En dicho documento podrías tener el siguiente script:
// el siguiente código se asume dentro de un tag


text:
Q: ternary operator and primitive types I come across at this code, and I am puzzled why ternary operator is behaving this way, (I didn't find exact same question on stackoverflow, so bear with me )
Have a look at this code
public class TernaryOperatorTester{
 public static void main(String []args){
  Integer i1 = 8;
  Integer i2 = 8;
  byte b1 = 3; //OK
  byte b2 = 5 + 4; //OK
  byte b3 = i1 == i2 ? 4 : 8; //KO!
  byte b4 = i1 == i2 ? (byte)4 : 8; //OK!!, else part do not need cast!
  short s1 = i1 == i2 ? 4 : 8; //KO! similarly
  short s2 = i1 == i2 ? (short)4 : 8;//OK!!,and again else part do not need  cast!
  }
}

first, what is returned in the ternary operator is literal value (it is not a expression is that is promoted to an int or other larger data types), - just like b1, and b2, so why b3 is not OK with literal value?
second, even if there is explanation for b3, why b4 is OK without cast in the else part of the expression ?
I put some other example with short data type, which has the same behavior.
thanks

A: The ternary operator is determining its return types based on the "if" and "else" values.  When it sees a "4" as the "if" value, it assumes it is returning an int type.  If "4" is cast as a byte, the ternary operator knows that it should return a byte type.
You do not need to cast the "else" value because the ternary operator already knows its return type, and the "else" value fits the type.

A: As for b3, an Integer is being assigned to a byte. Unboxing and narrow primitive conversion, do not go hand-to hand in a  implicit way.
Convert the Integer to an int, it will work or else type cast the Integer.


text:
Q: Aligning flowchart with tikz I'm working on some flowcharts for a programming course and have an alignment issue with one of them. Usually lines in a flowchart are directed from one symbol to another. However, I want the line to intersect with another line.
My existing TeX file:
\documentclass{article}

\usepackage[margin=1.0in]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}

\begin{document}
\pagestyle{empty}

\tikzstyle{decision}=[diamond, draw, fill=yellow!20,
  text width=7em, text badly centered, node distance=3cm,
  inner sep=0pt]
\tikzstyle{block}=[rectangle, draw, fill=blue!20,
  text width=10em, text badly centered, rounded corners,
  minimum height=4em]
\tikzstyle{line}=[draw, very thick, color=black!75, -latex']

\begin{center}
\begin{tikzpicture}[node distance=2cm, auto]
  % Place nodes
  \node [block] (read_first_integer) {Read first integer};
  \node [block, below of=read_first_integer] (read_second_integer)
        {Read second integer};
  \node [block, below of=read_second_integer] (read_third_integer)
        {Read third integer};
  \node [block, below of=read_third_integer] (calculate)
        {Calculate sum, product, difference};
  \node [decision, below of=calculate] (q_first_integer_smallest)
        {First integer less than second and third?};
  \node [block, on grid=false, below of=q_first_integer_smallest,
         node distance=3cm] (first_integer_smallest)
        {First integer is smallest};
  \node [decision, left of=q_first_integer_smallest,
         node distance=4.5cm] (q_second_integer_smallest)
        {Second integer less than second and third?};
  \node [block, below of=q_second_integer_smallest,
         node distance=3cm]
        (second_integer_smallest) {Second integer is smallest};
  \node [block, left of=q_second_integer_smallest,
         node distance=4.5cm] (third_integer_smallest)
        {Third integer is smallest};
  \node [decision, below of=first_integer_smallest,
         node distance=3.5cm] (q_first_integer_largest)
        {First integer larger than second and third?};

  % Draw edges
  \path [line] (read_first_integer) -- (read_second_integer);
  \path [line] (read_second_integer) -- (read_third_integer);
  \path [line] (read_third_integer) -- (calculate);
  \path [line] (calculate) -- (q_first_integer_smallest);
  \path [line] (q_first_integer_smallest) -- node [near start]
               {no} (q_second_integer_smallest);
  \path [line] (q_first_integer_smallest) -- node [near start]
               {yes} (first_integer_smallest);
  \path [line] (q_second_integer_smallest) -- node [near start]
               {no} (third_integer_smallest);
  \path [line] (q_second_integer_smallest) -- node [near start]
               {yes} (second_integer_smallest);
  \path [line] (first_integer_smallest) -- (q_first_integer_largest);
  \path [line] (second_integer_smallest) |- (q_first_integer_largest);
  \path [line] (third_integer_smallest) |- (q_first_integer_largest);
\end{tikzpicture}
\end{center}

\end{document}

The result:
I've done the following as a solution and am wondering if there is a simpler way:
\documentclass{article}

\usepackage[margin=0.5in]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}

\begin{document}
\pagestyle{empty}

\tikzstyle{decision}=[diamond, draw, fill=yellow!20,
  text width=7em, text badly centered, node distance=3cm,
  inner sep=0pt]
\tikzstyle{block}=[rectangle, draw, fill=blue!20,
  text width=10em, text badly centered, rounded corners,
  minimum height=4em]
\tikzstyle{line}=[draw, very thick, color=black!75, -latex']
\tikzstyle{empty}=[]

\begin{center}
\begin{tikzpicture}[node distance=2cm, auto]
  % Place nodes
  \node [block] (read_first_integer) {Read first integer};
  \node [block, below of=read_first_integer] (read_second_integer)
        {Read second integer};
  \node [block, below of=read_second_integer] (read_third_integer)
        {Read third integer};
  \node [block, below of=read_third_integer] (calculate)
        {Calculate sum, product, difference};
  \node [decision, below of=calculate] (q_first_integer_smallest)
        {First integer less than second and third?};
  \node [block, on grid=false, below of=q_first_integer_smallest,
         node distance=3cm] (first_integer_smallest)
        {First integer is smallest};
  \node [decision, left of=q_first_integer_smallest,
         node distance=4.5cm] (q_second_integer_smallest)
        {Second integer less than second and third?};
  \node [block, below of=q_second_integer_smallest,
         node distance=3cm]
        (second_integer_smallest) {Second integer is smallest};
  \node [empty, below of=second_integer_smallest, node distance=1.25cm,
         inner sep=0pt] (e_second_integer_smallest) {};
  \node [block, left of=q_second_integer_smallest,
         node distance=4.5cm] (third_integer_smallest)
        {Third integer is smallest};
  \node [empty, below of=first_integer_smallest, node distance=1.25cm,
         inner sep=0pt] (e_first_integer_smallest) {};

  \node [decision, below of=first_integer_smallest,
         node distance=4cm] (q_first_integer_largest)
        {First integer larger than second and third?};
  \node [block, below of=q_first_integer_largest,
         node distance=3cm] (first_integer_largest)
        {First integer is largest};
  \node [decision, left of=q_first_integer_largest,
         node distance=4.5cm] (q_second_integer_largest)
        {Second integer larger than second and third?};
  \node [block, below of=q_second_integer_largest,
         node distance=3cm] (second_integer_largest)
        {Second integer is largest};
  \node [empty, below of=second_integer_largest, node distance=2cm,
         inner sep=0pt] (e_second_integer_largest) {};
  \node [block, left of=q_second_integer_largest,
         node distance=4.5cm] (third_integer_largest)
        {Third integer is largest};
  \node [block, below of=first_integer_largest,
         node distance=2cm] (output) {Output results};

  % Draw edges
  \path [line] (read_first_integer) -- (read_second_integer);
  \path [line] (read_second_integer) -- (read_third_integer);
  \path [line] (read_third_integer) -- (calculate);
  \path [line] (calculate) -- (q_first_integer_smallest);

  \path [line] (q_first_integer_smallest) -- node [near start]
               {no} (q_second_integer_smallest);
  \path [line] (q_first_integer_smallest) -- node [near start]
               {yes} (first_integer_smallest);
  \path [line] (q_second_integer_smallest) -- node [near start]
               {no} (third_integer_smallest);
  \path [line] (q_second_integer_smallest) -- node [near start]
               {yes} (second_integer_smallest);
  \path [line] (first_integer_smallest) -- (q_first_integer_largest);
  \path [line] (second_integer_smallest) -- (e_second_integer_smallest);
  \path [line] (third_integer_smallest) |- (e_first_integer_smallest);

  \path [line] (q_first_integer_largest) -- node [near start]
               {no} (q_second_integer_largest);
  \path [line] (q_first_integer_largest) -- node [near start]
               {yes} (first_integer_largest);
  \path [line] (q_second_integer_largest) -- node [near start]
               {no} (third_integer_largest);
  \path [line] (q_second_integer_largest) -- node [near start]
               {yes} (second_integer_largest);
  \path [line] (first_integer_largest) -- (output);
  \path [line] (second_integer_largest) -- (e_second_integer_largest);
  \path [line] (third_integer_largest) |- (output);
\end{tikzpicture}
\end{center}

\end{document}

The result:
And, why is the line between "First integer larger than second and third?" and "first integer is largest" so small?

A: No need of defining a new node e_second_integer_largest. You can use orthogonal coordinates like
(second_integer_smallest |- q_first_integer_largest)

which means that x coordinate same as second_integer_smallest and y coordinate same as q_first_integer_largest in
\path [line] (second_integer_smallest) -- (second_integer_smallest |- q_first_integer_largest);

The  line between "First integer larger than second and third?" and "first integer is largest" so small because of an extra line of text. You can adjust the text width in the definition of decision node style like text width=8em,
\documentclass{article}

\usepackage[margin=0.5in]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}

\begin{document}
\pagestyle{empty}

\tikzstyle{decision}=[diamond, draw, fill=yellow!20,
  text width=8em, text badly centered, node distance=3cm,
  inner sep=0pt]
\tikzstyle{block}=[rectangle, draw, fill=blue!20,
  text width=10em, text badly centered, rounded corners,
  minimum height=4em]
\tikzstyle{line}=[draw, very thick, color=black!75, -latex']
\tikzstyle{empty}=[]

\begin{center}
\begin{tikzpicture}[node distance=2cm, auto]
  % Place nodes
  \node [block] (read_first_integer) {Read first integer};
  \node [block, below of=read_first_integer] (read_second_integer)
        {Read second integer};
  \node [block, below of=read_second_integer] (read_third_integer)
        {Read third integer};
  \node [block, below of=read_third_integer] (calculate)
        {Calculate sum, product, difference};
  \node [decision, below of=calculate] (q_first_integer_smallest)
        {First integer less than second and third?};
  \node [block, on grid=false, below of=q_first_integer_smallest,
         node distance=3cm] (first_integer_smallest)
        {First integer is smallest};
  \node [decision, left of=q_first_integer_smallest,
         node distance=4.5cm] (q_second_integer_smallest)
        {Second integer less than second and third?};
  \node [block, below of=q_second_integer_smallest,
         node distance=3cm]
        (second_integer_smallest) {Second integer is smallest};
%  \node [empty, below of=second_integer_smallest, node distance=1.25cm,
%         inner sep=0pt] (e_second_integer_smallest) {};
  \node [block, left of=q_second_integer_smallest,
         node distance=4.5cm] (third_integer_smallest)
        {Third integer is smallest};
  \node [empty, below of=first_integer_smallest, node distance=1.25cm,
         inner sep=0pt] (e_first_integer_smallest) {};

  \node [decision, below of=first_integer_smallest,
         node distance=4cm] (q_first_integer_largest)
        {First integer larger than second and third?};
  \node [block, below of=q_first_integer_largest,
         node distance=3cm] (first_integer_largest)
        {First integer is largest};
  \node [decision, left of=q_first_integer_largest,
         node distance=4.5cm] (q_second_integer_largest)
        {Second integer larger than second and third?};
  \node [block, below of=q_second_integer_largest,
         node distance=3cm] (second_integer_largest)
        {Second integer is largest};
%  \node [empty, below of=second_integer_largest, node distance=2cm,
%         inner sep=0pt] (e_second_integer_largest) {};
  \node [block, left of=q_second_integer_largest,
         node distance=4.5cm] (third_integer_largest)
        {Third integer is largest};
  \node [block, below of=first_integer_largest,
         node distance=2cm] (output) {Output results};

  % Draw edges
  \path [line] (read_first_integer) -- (read_second_integer);
  \path [line] (read_second_integer) -- (read_third_integer);
  \path [line] (read_third_integer) -- (calculate);
  \path [line] (calculate) -- (q_first_integer_smallest);

  \path [line] (q_first_integer_smallest) -- node [near start]
               {no} (q_second_integer_smallest);
  \path [line] (q_first_integer_smallest) -- node [near start]
               {yes} (first_integer_smallest);
  \path [line] (q_second_integer_smallest) -- node [near start]
               {no} (third_integer_smallest);
  \path [line] (q_second_integer_smallest) -- node [near start]
               {yes} (second_integer_smallest);
  \path [line] (first_integer_smallest) -- (q_first_integer_largest);
  \path [line] (second_integer_smallest) -- (second_integer_smallest |- e_first_integer_smallest);
  \path [line] (third_integer_smallest) |- (e_first_integer_smallest);

  \path [line] (q_first_integer_largest) -- node [near start]
               {no} (q_second_integer_largest);
  \path [line] (q_first_integer_largest) -- node [near start]
               {yes} (first_integer_largest);
  \path [line] (q_second_integer_largest) -- node [near start]
               {no} (third_integer_largest);
  \path [line] (q_second_integer_largest) -- node [near start]
               {yes} (second_integer_largest);
  \path [line] (first_integer_largest) -- (output);
  %\path [line] (second_integer_largest) -- (e_second_integer_largest);
  \path [line] (second_integer_largest) -- (second_integer_largest |- output);
  \path [line] (third_integer_largest) |- (output);
\end{tikzpicture}
\end{center}

\end{document}

A: Loading the positioning library you can use below = of <node name> instead of below of = <node name>. Then node distance=<length> means the distance between the node borders. So there is no more need to change the node distance depending on the node size.
I have also replaced \tikzstyle by \tikzset.
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}
\tikzset{
  decision/.style={diamond,draw,fill=yellow!20,text width=6em,
    inner sep=.1em,text badly centered},
  block/.style={draw, fill=blue!20,text width=10em,
    text badly centered, rounded corners,minimum height=4em},
  line/.style={draw, very thick, color=black!75, -latex'},
  empty/.style={inner sep=0pt}
}
\begin{document}
\pagestyle{empty}
\begin{center}
\begin{tikzpicture}[node distance=.6cm, auto]
  % Place nodes
  \node [block] (read_first_integer) {Read first integer};
  \node [block, below = of read_first_integer] (read_second_integer)
        {Read second integer};
  \node [block, below = of read_second_integer] (read_third_integer)
        {Read third integer};
  \node [block, below = of read_third_integer] (calculate)
        {Calculate sum, product, difference};
  \node [decision, below = of calculate] (q_first_integer_smallest)
        {First integer less than second and third?};
  \node [block, below = of q_first_integer_smallest] (first_integer_smallest)
        {First integer is smallest};
  \node [decision, left = of q_first_integer_smallest] (q_second_integer_smallest)
        {Second integer less than second and third?};
  \node [block, below = of q_second_integer_smallest]
        (second_integer_smallest) {Second integer is smallest};
  \node [block, left = of q_second_integer_smallest] (third_integer_smallest)
        {Third integer is smallest};
  \node [empty, below = of first_integer_smallest] (e_first_integer_smallest) {};
  \node [decision, below = of e_first_integer_smallest] (q_first_integer_largest)
        {First integer larger than second and third?};
  \node [block, below = of q_first_integer_largest] (first_integer_largest)
        {First integer is largest};
  \node [decision, left = of q_first_integer_largest] (q_second_integer_largest)
        {Second integer larger than second and third?};
  \node [block, below = of q_second_integer_largest] (second_integer_largest)
        {Second integer is largest};
  \node [block, left = of q_second_integer_largest] (third_integer_largest)
        {Third integer is largest};
  \node [block, below = of first_integer_largest] (output) {Output results};
  % Draw edges
  \begin{scope}[every path/.style=line]
    \path (read_first_integer) -- (read_second_integer);
    \path (read_second_integer) -- (read_third_integer);
    \path (read_third_integer) -- (calculate);
    \path (calculate) -- (q_first_integer_smallest);
    \path (q_first_integer_smallest)
          -- node [near start]{no} (q_second_integer_smallest);
    \path (q_first_integer_smallest)
          -- node [near start]{yes} (first_integer_smallest);
    \path (q_second_integer_smallest)
          -- node [near start]{no} (third_integer_smallest);
    \path (q_second_integer_smallest)
          -- node [near start]{yes} (second_integer_smallest);
    \path (first_integer_smallest) -- (q_first_integer_largest);
    \path (second_integer_smallest)
          -- (second_integer_smallest |- e_first_integer_smallest);
    \path (third_integer_smallest) |- (e_first_integer_smallest);
    \path (q_first_integer_largest)
          -- node [near start]{no} (q_second_integer_largest);
    \path (q_first_integer_largest)
          -- node [near start]{yes} (first_integer_largest);
    \path (q_second_integer_largest)
          -- node [near start]{no} (third_integer_largest);
    \path (q_second_integer_largest)
          -- node [near start]{yes} (second_integer_largest);
    \path (first_integer_largest) -- (output);
    \path (second_integer_largest) -- (second_integer_largest |- output);
    \path (third_integer_largest) |- (output);
  \end{scope}
\end{tikzpicture}
\end{center}
\end{document}

Result:

Another possibility is using a matrix to position the nodes. The column sep and the row sep are the minimum distance between the borders of the nodes.
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,matrix}
\tikzset{
  decision/.style={diamond,draw,fill=yellow!20,text width=6em,
    text badly centered,inner sep=.1em},
  block/.style={draw, fill=blue!20,text width=10em,
    text badly centered, rounded corners,minimum height=4em},
  line/.style={draw, very thick, color=black!75, -latex'},
  empty/.style={inner sep=0pt}
}
\begin{document}
\pagestyle{empty}
\begin{center}
\begin{tikzpicture}[auto]
  % Place nodes
  \matrix[matrix of nodes,row sep=6mm,column sep=6mm,nodes={anchor=center}]{
    &&|[block](read_first_integer)|Read first integer\\
    &&|[block](read_second_integer)|Read second integer\\
    &&|[block](read_third_integer)|Read third integer\\
    &&|[block](calculate)|Calculate sum, product, difference\\
    |[block](third_integer_smallest)|Third integer is smallest&
      |[decision](q_second_integer_smallest)|Second integer less than second and third?&
      |[decision](q_first_integer_smallest)|First integer less than second and third?\\
    &|[block](second_integer_smallest)|Second integer is smallest&
      |[block](first_integer_smallest)|First integer is smallest\\
    &&|[empty](e_first_integer_smallest)|\\
    |[block](third_integer_largest)|Third integer is largest?&
      |[decision](q_second_integer_largest)|Second integer larger than second and third?&
      |[decision](q_first_integer_largest)|First integer larger than second and third?\\
    &|[block](second_integer_largest)|Second integer is largest&
      |[block](first_integer_largest)|First integer is largest\\
    &&|[block](output)|Output results\\
  };
  % Draw edges
  \begin{scope}[every path/.style=line]
    \path (read_first_integer) -- (read_second_integer);
    \path (read_second_integer) -- (read_third_integer);
    \path (read_third_integer) -- (calculate);
    \path (calculate) -- (q_first_integer_smallest);
    \path (q_first_integer_smallest)
          -- node [near start]{no} (q_second_integer_smallest);
    \path (q_first_integer_smallest)
          -- node [near start]{yes} (first_integer_smallest);
    \path (q_second_integer_smallest)
          -- node [near start]{no} (third_integer_smallest);
    \path (q_second_integer_smallest)
          -- node [near start]{yes} (second_integer_smallest);
    \path (first_integer_smallest) -- (q_first_integer_largest);
    \path (second_integer_smallest)
          -- (second_integer_smallest |- e_first_integer_smallest);
    \path (third_integer_smallest) |- (e_first_integer_smallest);
    \path (q_first_integer_largest)
          -- node [near start]{no} (q_second_integer_largest);
    \path (q_first_integer_largest)
          -- node [near start]{yes} (first_integer_largest);
    \path (q_second_integer_largest)
          -- node [near start]{no} (third_integer_largest);
    \path (q_second_integer_largest)
          -- node [near start]{yes} (second_integer_largest);
    \path (first_integer_largest) -- (output);
    \path (second_integer_largest) -- (second_integer_largest |- output);
    \path (third_integer_largest) |- (output);
  \end{scope}
\end{tikzpicture}
\end{center}
\end{document}

Result:


text:
Q: how to Add custom Convention for caliburn.micro? In my project,I need to binding visibility of ui element to a bool property,as you know caliburn.micro has convention "CanName",so i think to add my own custom convention.
then i found this [Visibility Autobinding with naming convention i add this code in my project,but it not work and convention "CanName" doesn't work too.
ConventionManager.AddElementConvention<FrameworkElement>(Control.VisibilityProperty, "Visibility", "IsVisible");
            var baseBindProperties = ViewModelBinder.BindProperties;
            ViewModelBinder.BindProperties = (frameWorkElements, viewModel) =>
            {
                BindVisiblityProperties(frameWorkElements, viewModel);
                return baseBindProperties(frameWorkElements, viewModel);
            };

static void BindVisiblityProperties(IEnumerable<FrameworkElement> items, Type viewModel)
        {
            foreach (FrameworkElement element in items)
            {
                string PropertyName = element.Name + "IsVisible";
                var property = viewModel.GetPropertyCaseInsensitive(PropertyName);
                if (property != null)
                {
                    var convention = ConventionManager.GetElementConvention(typeof(FrameworkElement));
                    ConventionManager.SetBindingWithoutBindingOverwrite(viewModel, PropertyName, property,
                        element, convention, convention.GetBindableProperty(element));
                }
            }
        }

anyone know what wrong with this code ?

A: I'm using this Convention in my project without any issues. Here is a walkthrough:
In the AppBootstrapper.cs you include the Element Convention among other given Conventions
private static void AddCustomConventions()
{
    ConventionManager.AddElementConvention<FrameworkElement>(Control.VisibilityProperty, "Visibility", "IsVisible");
    var baseBindProperties = ViewModelBinder.BindProperties;
    ViewModelBinder.BindProperties = (frameWorkElements, viewModel) =>
    {
        BindVisiblityProperties(frameWorkElements, viewModel);
        return baseBindProperties(frameWorkElements, viewModel);
    };
}

and your helper method:
private static void BindVisiblityProperties(IEnumerable<FrameworkElement> items, Type viewModel)
{
    foreach (FrameworkElement element in items)
    {
        string PropertyName = element.Name + "IsVisible";
        var property = viewModel.GetPropertyCaseInsensitive(PropertyName);
        if (property != null)
        {
            var convention = ConventionManager.GetElementConvention(typeof(FrameworkElement));
            ConventionManager.SetBindingWithoutBindingOverwrite(
                viewModel, PropertyName, property, element, convention, convention.GetBindableProperty(element));
        }
    }
}

In your PageView.xaml you place your Controls and provide a x:Name
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
    <Button x:Name="StartRecord">start</Button>
    <Button x:Name="StopRecord">stop</Button>
    <Button x:Name="Foo">foo</Button>
    <Button x:Name="Bar">bar</Button>
</StackPanel>

within your PageViewModel.cs you place a public property of type bool with the suffix IsVisible
public bool FooIsVisible { get { return true; } }

public bool BarIsVisible { get { return false; } }


text:
Q: How to add description to image while posting what should I add in code so that it will add description to image
Bitmap bi = BitmapFactory.decodeFile("/sdcard/viewitems.png");

ByteArrayOutputStream baos = new ByteArrayOutputStream();
bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();

Bundle params = new Bundle();
params.putString(Facebook.TOKEN, facebook.getAccessToken());
params.putString("method", "photos.upload");
params.putByteArray("picture", data);

AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);

A: Add the below lines,
params.putString("caption", "your Caption message goes here");
params.putString("description", "your Description text goes here");

So the key denotes the parameter type and the value gets you the actual message.


text:
Q: fiddler tunnelled http requests to port 443 I've got Fiddler to decrypt https traffic. which works just fine.
http://fiddler2.com/documentation/Configure-Fiddler/Tasks/DecryptHTTPS
But there are some requests that are shown as "Tunnel to" port 443. Also the protocol of these requests are shown as HTTP instead of HTTPS. I do not see the decrypted content of these requests.

on the response details pane, it's shown as below:

Can someone let me know how I can get fiddler to decrypt these tunnelled requests too. Also appreciate if you could provide me some details about what's going on in this case.
Cheers

A: As noted in the inspector description the line Tunnel to example.org:443 is the first line of a successful captured HTTPS call.
It is notes as HTTP because at that time the HTTPS channel has not been established yet.
If afterwards no further HTTPS requests to that server are shown this means that the program performing the request has not accepted the presented server certificate generated by Fiddler and therefore the HTTPS requests failed.
There are two possible explanations:

*

*The program performing the requests does not trust the Fiddle root CA certificate.
For programs that don't use the Windows certificate store (e.g. Firefox) you have to export this root ca certificate from Fiddler and install it manually into the program's certificate trusted store (list of trusted root-CA certificates).

*A second possibility is that the site is certificate pinned. For web browsers this can happen is the web site uses the HSTS configuration.


text:
Q: How set hyphen (divis) to specific unicode char I need a specific divis / hyphen character or more than one randomly show
This code is not working at the present.  Does anyone have any suggestions?
\documentclass{minimal}
\usepackage{blindtext}
\usepackage[htt]{hyphenat}
\newsavebox\leftarrowbox
\sbox\leftarrowbox{$\leftarrow$}

\makeatletter
\renewcommand*{\BreakableSlash}{%
\leavevmode \prw@zbreak /%
\discretionary{\usebox\leftarrowbox}{}{}%
\prw@zbreak }
\makeatother

\begin{document}

\parbox{40mm}{%
\texttt{/etc\fshyp really\fshyp long\fshyp directory\fshyp name/ \blindtext}%
}

\end{document}


text:
Q: Is it better to use fewer tables with more columns or vice versa? I'm trying to figure out how to determine the best balance in structuring a database.  I want to be able to store the information from several different forms submitted by different people, sometimes multiple times (such as a yearly update).  I'm stuck between having a different table for each form, or a combination of form and element definition and element value tables.
Example A: There are three types of form with different information, so there are four tables, [FormA], [FormB], and [FormC] that each have the data associated with their respective forms, all FKed to [Customers].
Example B: Same three forms, but this time there are five different tables.  [FormDescriptions] defines the form names, types, etc and has three entries, one for each form.  [Forms] FKs to [Customers] and [FormDescriptions] and uses these in combination with the submission date to distinguish individual submissions. [FormElements] defines all the elements from the three forms, with a FK on FormDescriptions and a unique elementID.  [ElementValues] FKs to [FormElements] and [Forms] and stores the value of the selected element on the selected form.
My question is, is one of these methods inherently better than the other, and if not, in which situations is each better than the other?  As much why or why not that you want to include is appreciated.

A: "My question is, is one of these methods inherently better than the other, and if not, in which situations is each better than the other? As much why or why not that you want to include is appreciated."
Your option two is (your personalized variant of) the EAV antipattern.  If you use this, and you expect (now or later) the system to do anything "intelligent" with the data, you'll find yourself in serious trouble.  And things as basic as "rigorous data validation to catch data entry errors" already qualifies as "intelligent".  So only use it if you can reasonably anticipate that the system will only be used for just merely storing the data, and that it will be unlikely for there ever to be a request to start processing/manipulating the data in "intelligent ways".
If you ever run into requests to start doing "intelligent" things with an EAV database, you'll find that whatever development time you thought you gained by working from a super duper generic information model, you'll lose orders of magnitude more time coding all the "intelligent" things required, i.e. reinstating the data structures in code that you refused to reflect in the DB.
Googling for "EAV antipattern" (try to locate the book by Bill Karwin) should provide you with more than enough info on why not to do it.

A: There are 2 factors in consideration here

*

*Performance

*flexibility

If your system is such that it will require you to add more forms in future frequently.. method 2 is better. You won't have to add additional tables or columns. Your forms are data driven. It will add little overhead for generating forms and saving as key value pairs.
On other hand if your system won't require many changes to forms first method can work.
Also consider usage of data after forms are submitted. Are you going to run analytics, reports on this data? Are these reports specific to forms? That will favor method 1.


text:
Q: How to reproject spatial data using free libraries? How can I use free libraries to transform spatial data?
For example,
I want to change the projection of a Shapefile within the code of my C# web application. How do I do that?

A: Another alternative is http://projnet.codeplex.com/

A: There is also GDAL/OGR: http://trac.osgeo.org/gdal/wiki/GdalOgrInCsharp
The page looks quite old, I'm not sure if the bindings are up to date.

A: I was a bit surprised nobody mentioned proj.4 and shapelib. Although both are C projects, C# bindings have been made (or you could just p/invoke them).

A: You can try the DotSpatial.Projections library.
The website lists an example "Converting from a Geographic Coordinate System to a Projected Coordinate System":
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DotSpatial.Projections;

namespace WindowsFormsApplication1
{
  public partial class Form1 : Form
  {
    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        //Sets up a array to contain the x and y coordinates
        double[] xy = new double[2];
        xy[0] = 0;
        xy[1] = 0;
        //An array for the z coordinate
        double[] z = new double[1];
        z[0] = 1;
        //Defines the starting coordiante system
        ProjectionInfo pStart = KnownCoordinateSystems.Geographic.World.WGS1984;
        //Defines the ending coordiante system
        ProjectionInfo pEnd = KnownCoordinateSystems.Projected.NorthAmerica.USAContiguousLambertConformalConic;
        //Calls the reproject function that will transform the input location to the output locaiton
        Reproject.ReprojectPoints(xy, z, pStart, pEnd, 0, 1);
        Interaction.MsgBox("The points have been reporjected.");
    }
  }
}


text:
Q: iOS display notification based on incoming phone call Is it possible to have a background app display a notification based on who is contact details from an incoming caller, either before the call is answered or during?

A: No, the system will not allow you to interact with phone calls in any way.

A: You can set the image for certain people in the address book using the Address Book API. That way, a certain background image (potentially with a textual message) will be shown, based on who is calling.

A: With time, things change. Look at sync.me, when you get an incoming call, the latest post on facebook will show just above the accept/decline button. Though I still can't get the idea of how it is done.


text:
Q: Insert item into a sorted list with Julia (with and without duplicates) Main Question: What is the fastest way to insert an item into a list that is already sorted using Julia?
Currently, I do this:
v = [1, 2, 3, 5] #example list
x = 4 #value to insert
index = searchsortedfirst(v, x) #find index at which to insert x
insert!(v, index, x) #insert x at index

Bonus Question: What if I want to simultaneously ensure no duplicates?

A: You can use searchsorted to get the range of indices where the value occurs instead of just the first one and then use splice! to replace the values in that range with a new set of values:
insert_and_dedup!(v::Vector, x) = (splice!(v, searchsorted(v,x), [x]); v)

That's a nice little one-liner that does what you want.
julia> v = [1, 2, 3, 3, 5];

julia> insert_and_dedup!(v, 4)
6-element Array{Int64,1}:
 1
 2
 3
 3
 4
 5

julia> insert_and_dedup!(v, 3)
5-element Array{Int64,1}:
 1
 2
 3
 4
 5

This made me think that splice! should handle the case where the replacement is a single value rather than an array, so I may add that feature.


text:
Q: Integrate $\int_0^\infty x(y+x)^{n-2}dx$ How would one integrate this $$\int_0^\infty x(y+x)^{n-2}dx \quad$$I can't think of ways of going about solving this.

A: $$\int_{0}^{\infty}x(y+x)^{n-2}\space\text{d}x=\lim_{a\to\infty}\int_{0}^{a}x(y+x)^{n-2}\space\text{d}x=$$

Substitute $u=y+x$ and $\text{d}u=\text{d}x$.
This gives a new lower bound $u=y+0=y$ and upper bound $u=y+a$:

$$\lim_{a\to\infty}\int_{y}^{y+a}u^{n-2}(u-y)\space\text{d}u=$$
$$\lim_{a\to\infty}\int_{y}^{y+a}\left[u^{n-1}-yu^{n-2}\right]\space\text{d}u=$$
$$\lim_{a\to\infty}\left[\int_{y}^{y+a}u^{n-1}\space\text{d}u-y\int_{y}^{y+a}u^{n-2}\space\text{d}u\right]=$$
$$\lim_{a\to\infty}\left[\left[\frac{u^n}{n}\right]_{y}^{y+a}-\left[\frac{u^{n-1}}{n-1}\right]_{y}^{y+a}\right]=$$
$$\lim_{a\to\infty}\left[\frac{(a+y)^n-y^n}{n}-\frac{(a+y)^{n-1}-y^{n-1}}{n-1}\right]=\frac{y^n}{n(n-1)}$$
This is true when:
$$\Re[n]<0\space\wedge\space\Re[y]>0\space\wedge\space2\arg\left[\frac{1}{y}\right]\le\pi$$

A: Here's an idea with a substitution:
$$(y+x)^{n-2}=y^{n-2}\left(1+\frac xy\right)^{n-2}\implies \text{substitute}\;\;\,t:=1+\frac xy\;,\;\;dt=\frac{dx}y\implies$$
$$\int_0^\infty x(y+x)^{n-2}dx=y^{n-1}\int_1^\infty t^{n-2}y(t-1)\;dt=$$
$$=y^n\int_1^\infty \left(t^{n-1}-t^{n-2}\right)dt=\left.y^n\lim_{b\to\infty}\left(\frac1n\,t^n-\frac1{n-1}\,t^{n-1}\right)\right|_1^b=$$$${}$$
$$=\begin{cases}\text{doesn't exist finitely},\;&|t|\ge1\\{}\\y^n\left(-\frac1n+\frac1{n-1}\right)=\frac{y^n}{n(n-1)},\;&|t|<1\end{cases}$$