mercredi 5 octobre 2016

How to handle "As Of Reports" by Microsoft SSIS process, SSAS cube and SSRS report?

Vote count: 0

A simple scenario:

A bank named aBank. The aBank has multiple customer accounts. Each account has multiple transactions. There are only two types of transactions: Deposit and Withdraw.

In the source database, there are two tables: AccountInfo (Id, AccountCode) and Transaction (Id, TransDate, TransType, TransAmount, Balance).

Now the management team would like to have a report in SSRS to show the balance of the whole bank as of an input date.

For example, they want to know the balance of the whole bank in 2010-03-05 or yesterday.

What is a good practice to design the SSIS package, the SSAS cube and the SSRS report?

Thank you.

asked 10 secs ago

Let's block ads! (Why?)



How to handle "As Of Reports" by Microsoft SSIS process, SSAS cube and SSRS report?

Printing star and character triangle in java

Vote count: 0

So i have to create program that outputs a star and the letter o. I have gotten it working for the most part but the output is not 100% correct, minor things really. 
Here is my code so far: 
for(int i = 1; i <=numRows; i++){
                    System.out.print("\n");
                    for(int j = 0; j<=numRows; j++){
                        if(i+j >= numRows){
                            System.out.print('*');
                            System.out.print("o");
                        }else {
                            System.out.print(" ");
                        }
                    }
                    System.out.println();

And here is a screenshot of what the output is supposed to look likeScreenshot of the desired output

asked 10 secs ago

Let's block ads! (Why?)



Printing star and character triangle in java

How to design blog layout on wordpress

Vote count: 0

i am kinda stocked in a project, had desinged and created a wordpress theme, had made it install-able had done the widget sidebars and menu aspect , but my problem is designing the blog layout i mean getting the foreach() parameter to display all blog post, if possible with pagination and thumbnail my bootstrap code looks like this.

    <div class="pc-version">
    <div class="media">
    <div class="media-left">
    <div class="hovereffect">


                <a href="#">
                    <img class="media-object" src="img/1.jpg" alt="..."></a>
            <div class="overlay">
            <h2>Share</h2>
            <p class="icon-links">
                <a href="#">
                    <span class="fa fa-twitter"></span>
                </a>
                <a href="#">
                    <span class="fa fa-facebook"></span>
                </a>
                <a href="#">
                    <span class="fa fa-instagram"></span>
                </a>
            </p>
        </div>

            </div>
            </div>
        <div class="media-body">
            <h4 class="media-heading">5 marketing strategy that Would "freak you out.</h4>
            <p class="media-author"><b>Neon Emmanuel</b> - Sept 28, 2016</p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in nisi vitae nisi consequat hendrerit ac non odio. 
                Maecenas mattis iaculis mi, vitae lacinia massa fringilla ut. Vestibulum in dapibus lectus, suscipit imperdiet leo.
                Sed tristique, nibh eget feugiat fringilla, mauris libero scelerisque enim, vitae ullamcorper eros tortor eu ex.
            </div>
    </div>

    <div class="media">
    <div class="media-left">
    <div class="hovereffect">


                <a href="#">
                    <img class="media-object" src="img/2.jpg" alt="..."></a>
            <div class="overlay">
            <h2>Share</h2>
            <p class="icon-links">
                <a href="#">
                    <span class="fa fa-twitter"></span>
                </a>
                <a href="#">
                    <span class="fa fa-facebook"></span>
                </a>
                <a href="#">
                    <span class="fa fa-instagram"></span>
                </a>
            </p>
        </div>

            </div>
            </div>
        <div class="media-body">
            <h4 class="media-heading">6 resons we all love Califonia</h4>
            <p class="media-author"><b>Neon Emmanuel</b> - Sept 28, 2016</p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in nisi vitae nisi consequat hendrerit ac non odio. 
                Maecenas mattis iaculis mi, vitae lacinia massa fringilla ut. Vestibulum in dapibus lectus, suscipit imperdiet leo.
                Sed tristique, nibh eget feugiat fringilla, mauris libero scelerisque enim, vitae ullamcorper eros tortor eu ex.
            </div>
    </div>

    <div class="media">
    <div class="media-left">
    <div class="hovereffect">


                <a href="#">
                    <img class="media-object" src="img/3.jpg" alt="..."></a>
            <div class="overlay">
            <h2>Share</h2>
            <p class="icon-links">
                <a href="#">
                    <span class="fa fa-twitter"></span>
                </a>
                <a href="#">
                    <span class="fa fa-facebook"></span>
                </a>
                <a href="#">
                    <span class="fa fa-instagram"></span>
                </a>
            </p>
        </div>

            </div>
            </div>
        <div class="media-body">
            <h4 class="media-heading">Vacation vs' Home coming :-) </h4>
            <p class="media-author"><b>Neon Emmanuel</b> - Sept 28, 2016</p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in nisi vitae nisi consequat hendrerit ac non odio. 
                Maecenas mattis iaculis mi, vitae lacinia massa fringilla ut. Vestibulum in dapibus lectus, suscipit imperdiet leo.
                Sed tristique, nibh eget feugiat fringilla, mauris libero scelerisque enim, vitae ullamcorper eros tortor eu ex.
            </div>
    </div>

    <div class="media">
    <div class="media-left">
    <div class="hovereffect">


                <a href="#">
                    <img class="media-object" src="img/4.jpg" alt="..."></a>
            <div class="overlay">
            <h2>Share</h2>
            <p class="icon-links">
                <a href="#">
                    <span class="fa fa-twitter"></span>
                </a>
                <a href="#">
                    <span class="fa fa-facebook"></span>
                </a>
                <a href="#">
                    <span class="fa fa-instagram"></span>
                </a>
            </p>
        </div>

            </div>
            </div>
        <div class="media-body">
            <h4 class="media-heading">the real way to eat pancakes</h4>
            <p class="media-author"><b>Neon Emmanuel</b> - Sept 28, 2016</p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in nisi vitae nisi consequat hendrerit ac non odio. 
                Maecenas mattis iaculis mi, vitae lacinia massa fringilla ut. Vestibulum in dapibus lectus, suscipit imperdiet leo.
                Sed tristique, nibh eget feugiat fringilla, mauris libero scelerisque enim, vitae ullamcorper eros tortor eu ex.
            </div>
    </div>

    <div class="media">
    <div class="media-left">
    <div class="hovereffect">


                <a href="#">
                    <img class="media-object" src="img/5.jpg" alt="..."></a>
            <div class="overlay">
            <h2>Share</h2>
            <p class="icon-links">
                <a href="#">
                    <span class="fa fa-twitter"></span>
                </a>
                <a href="#">
                    <span class="fa fa-facebook"></span>
                </a>
                <a href="#">
                    <span class="fa fa-instagram"></span>
                </a>
            </p>
        </div>

            </div>
            </div>
        <div class="media-body">
            <h4 class="media-heading">Sklic , slim tall and skiny Girls - "my Source of joy" at Miama</h4>
            <p class="media-author"><b>Neon Emmanuel</b> - Sept 28, 2016</p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in nisi vitae nisi consequat hendrerit ac non odio. 
                Maecenas mattis iaculis mi, vitae lacinia massa fringilla ut. Vestibulum in dapibus lectus, suscipit imperdiet leo.
                Sed tristique, nibh eget feugiat fringilla, mauris libero scelerisque enim, vitae ullamcorper eros tortor eu ex.
            </div>
    </div>
    </div>

please any one to place the thumbnail code and wordpress display all post code where it suppose to be , would be very great-full.

asked 29 secs ago

Let's block ads! (Why?)



How to design blog layout on wordpress

How to get the body of a push notification sent from firebase console in iOS 10 and swift 3?

Vote count: 0

i'm developing an iOS app that should receive push notifications sent from the firebase console. I'm using Swift 3 and iOS10. As recommended by firebase documentation, we must assign our delegate object to the UNUserNotificationCenter object to receive display notifications, and the FIRMessaging object to receive data messages, before our app finishes launching. This has been done in the didFinishLaunchingWithOptions method. I followed all the steps in order to configure Firmessaging as well as APNs.

Now, when i send a message from the firebase console, i receive it through applicationReceivedRemoteMessage(_ remoteMessage: FIRMessagingRemoteMessage) method. The problem is that i could not extract the body of the message from the remoteMessage.appData dictionary. Knowing that the body is within remoteMessage.appData["notification"] which is equal to

[AnyHashable("notification"): {
   body = Hello Notifications;
   e = 1;
}, AnyHashable("from"): 49679924394, AnyHashable("collapse_key"): com.company.app]

I could not extract the body in order to show it in an alert controller. The code of the appDelegate is given below.

class AppDelegate: UIResponder, UIApplicationDelegate, FIRMessagingDelegate, UNUserNotificationCenterDelegate{
......

func application(_ application: UIApplication, didFinishLaunchingWithOptions, launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    application.isStatusBarHidden = true
    FIRApp.configure()
    FIRDatabase.database().persistenceEnabled = true
    if #available(iOS 10.0, *) {
       let authOptions : UNAuthorizationOptions = [.alert, .badge, .sound]
       let center = UNUserNotificationCenter.current()
       center.requestAuthorization(options: authOptions, completionHandler: {_ ,_ in })
       application.registerForRemoteNotifications()
// For iOS 10 display notification (sent via APNS)
       UNUserNotificationCenter.current().delegate = self
// For iOS 10 data message (sent via FCM)        
       FIRMessaging.messaging().remoteMessageDelegate = self         
    } else {
       let settings: UIUserNotificationSettings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
       application.registerUserNotificationSettings(settings)
    }
    application.registerForRemoteNotifications()
     return true
}
// Receive data message on iOS 10 devices.
func applicationReceivedRemoteMessage(_ remoteMessage: FIRMessagingRemoteMessage) {
    print(remoteMessage.appData)
    print(remoteMessage.appData["notification"]!)
    let alertController = UIAlertController(title: "Message from IOBird Developer Team", message: "?????? Body of the message ?????", preferredStyle: .alert)
    let OKAction = UIAlertAction(title: "OK", style: .default) { (action:UIAlertAction!) in
    }
    alertController.addAction(OKAction)
    self.window?.rootViewController?.present(alertController, animated: true, completion: nil)
}

asked 36 secs ago

Let's block ads! (Why?)



How to get the body of a push notification sent from firebase console in iOS 10 and swift 3?

c# WindowsForms: Treeview set selectednode when retrieving focus

Vote count: 0

I'm having some trouble when dealing with a BeforeSelect event AND a pop-up when no treenode is selected in my treeview.

Basically, I am trying to restrict the use of some treenodes depending on the context. Since treenodes do not have "Enable" flags, I do it with the well-known BeforeSelectEvent:

private void treeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
    if(! isEnabled( e.Node ) ) e.Cancel = true;
}

So far, so good, it works like a charm. But of course, I got complains that "this is not working anymore" and a pop-up would be needed to let the end user know this is a PEBKAC scenario. Easy enough since the application containing my UI has a logging system allowing it.

private void treeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
    if( isEnabled( e.Node ) ) return;
    e.Cancel = true;
    parentApplication.LoggingSystem.ErrorPopup("You are an Idiot");
}

The user is then prompted to hit "OK", which gives the focus away from my UI, then closes the pop-up... and gives back focus on my UI (especially my treeview). Nice enough. And it works fine. Except if the canceled node is the first node the user triggered. In which case, when the TreeView retrieves its focus, it changes the selectedNode from null to TreeView.Nodes[0]. Which in turns triggers a lot of events because of course my Nodes[0] has to do server calls against THE server containing THE big database.

Right now the only solutions I've explored look like ducktaping: - now showing up the popup in this specific case works but this is not a correct behavior - forcing the focus to another element of the UI before showing the popup somehow fails (focus comes back at a point?) - setting a flag before showing up the pop-up so that the "afterselect" can abort somehow fails too (looks like focus is given back when leaving beforeselect() as well ?)

Do you have a clean way to show the popup without triggering the focus() ?

asked 26 secs ago

Let's block ads! (Why?)



c# WindowsForms: Treeview set selectednode when retrieving focus

Integrate ionic cloud service in ionic 1.3

Vote count: 0

How can i integrate ionic cloud service in my ionic 1.3 app.I don't understand how to integrate it in typescript in my app in javascript.

asked 39 secs ago

Let's block ads! (Why?)



Integrate ionic cloud service in ionic 1.3

Unrecognized option: -modulepath

Vote count: 0

Is anyone else having this issue when they run the module it complains about this in java 9 mac version?

Below is the issue!

Unrecognized option: -modulepath
Error: Could not create the Java Virtual Machine.

How to reproduce ? I am doing this example. The last step is to run the module using below command. That's when i see the issue.

java -modulepath mods -m com.mycompany.helloworld/com.mycompany.helloworld.HelloWorld

Here is some background information. . I started playing with java 9 (mac version).

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+138)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+138, mixed mode)

I can not even uninstall the java 9 properly. But, I will solve that later.

any help will be appreciated!

asked 15 secs ago

Let's block ads! (Why?)



Unrecognized option: -modulepath

Subclassing QLabel and use it in QWidget class

Vote count: 0

When i try to put QLabel in QWidget class its not work properly (no hover event or click event only the label pixmap is show) only the last instance work properly,

this is QLabel subclass header:

#include <QObject>
#include <QLabel>
class myLabel : public QLabel
{
    Q_OBJECT
public:
    myLabel();

protected:
    void mousePressEvent(QMouseEvent *);
    void enterEvent(QEvent *);
    void leaveEvent(QEvent *);


signals :
    void labelClicked();
    void enterSignal();
    void leaveEventSignal();

private:

};

this class to make a labelButton:

#include <QObject>
#include <QWidget> 
#include "mylabel.h"
class labelButton : public QWidget
{
    Q_OBJECT
public:
    labelButton();

    //some functions

private slots:
    //slots

private:
   //private member
};

and this the class that i want to use the labelButtons in:

#include <QWidget> 
#include "labelbutton.h"

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

private:
    Ui::Widget *ui;

    labelButton *b_1, *b_2;

};

here is widget.cpp:

   Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    b_1 = new labelButton;
    b_1->setParent(this);
    b_1->moveButton(70, 100);
    //some functions to initialize the labelButton
    b_1->show();

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

    b_2 = new labelButton;
    b_2->setParent(this);
    b_2->moveButton(70, 200);
    //some functions to initialize the labelButton
    b_2->show();

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

    labelButton *b_3 = new labelButton;
    b_3->setParent(this);
    b_3->moveButton(70, 300);
    //some functions to initialize the labelButton
    b_3->show();
}

asked 15 secs ago

Let's block ads! (Why?)



Subclassing QLabel and use it in QWidget class

Using express-sessions: unable to get variable

Vote count: 0

I am new to using express-sessions and I'm unsure of what I'm doing wrong and/or not understanding about how to use express-sessions. Essentially I want to pass information that will have state as a user navigates to different routes, and I believe that I can use express-session for this, correct?

In the example below (two separate route js files) I have a req.session variable set, and when the user goes to a different route I wanted to pull up that req.session variable. However, req.session doesn't show the variable. Hopefully someone can help, your input is appreciated!

login.js route

...
let session = require('express-session');
app.use(session({
    secret: "why is this not working",
    resave: true,
    saveUnintialized: true,
    cookie: { maxAge: 60000 }
  }));

router.get('/myUrl', function(req, res) {
  req.session.test = 'true';
  res.render('/myForm.jade');
});
...

user.js route

...
let session = require('express-session');
app.use(session({
    secret: "why is this not working",
    resave: true,
    saveUnintialized: true,
    cookie: { maxAge: 60000 }
  }));
router.post('/login', function(req, res, next) {
console.log('req.session.test: '+req.session.test); 
console.log(req.session);
...

user.js output:

req.session.test: undefined

Session {
  cookie: 
   { path: '/',
     _expires: 2016-10-05T19:40:37.291Z,
     originalMaxAge: 60000,
     httpOnly: true } }

asked 8 secs ago

Let's block ads! (Why?)



Using express-sessions: unable to get variable

How to Modify/PUSH AVD Host File from Windows Command Prompt?

Vote count: 0

Following the directions found here "Testing Local Web Sites with the Android Emulator", I've been successful up until Make your changes to the hosts file and then save it back to the AVD. In other words, I'm unable to push my modified host file back to the AVD. The directions in the article are for Mac, so I've converted the command lines to windows.

The Mac command referenced in the article is this...

$ ~/Library/Android/sdk/platform-tools/adb -s emulator-5554 push ~/Desktop/hosts /system/etc/hosts

Which I've translated to Windows as this...

$ adb –s emulator-5554 push C:\Users\<username>\Downloads\hosts /system/etc/hosts 

Note:

  • for the windows command, I'm already in the C://platform-tools/ directory, where adb lives
  • The in my local path is a placeholder for my actual username
  • The modified host file does exist at the path specified.

When I run the adb command to push the host file back to the AVD, the file is not pushed and I see this output in the terminal...

C:\Users\<username>\AppData\Local\Android\sdk\platform-tools>adb -s emu
lator-5554 push C:\Users\<username>\Downloads\hosts /system/etc/hosts
Android Debug Bridge version 1.0.36
Revision e02fe72a18c3-android

 -a                            - directs adb to listen on all interfaces for a c
onnection
 -d                            - directs command to the only connected USB devic
e
                                 returns an error if more than one USB device is
 present.
 -e                            - directs command to the only running emulator.
                                 returns an error if more than one emulator is r
unning.
 -s <specific device>          - directs command to the device or emulator with
the given
                                 serial number or qualifier. Overrides ANDROID_S
ERIAL
                                 environment variable.
 -p <product name or path>     - simple product name like 'sooner', or
                                 a relative/absolute path to a product
                                 out directory like 'out/target/product/sooner'.

                                 If -p is not specified, the ANDROID_PRODUCT_OUT

                                 environment variable is used, which must
                                 be an absolute path.
 -H                            - Name of adb server host (default: localhost)
 -P                            - Port of adb server (default: 5037)
 devices [-l]                  - list all connected devices
                                 ('-l' will also list device qualifiers)
 connect <host>[:<port>]       - connect to a device via TCP/IP
                                 Port 5555 is used by default if no port number
is specified.
 disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                 Port 5555 is used by default if no port number
is specified.
                                 Using this command with no additional arguments

                                 will disconnect from all connected TCP/IP devic
es.

device commands:
  adb push <local>... <remote>
                               - copy files/dirs to device
  adb pull [-a] <remote>... <local>
                               - copy files/dirs from device
                                 (-a preserves file timestamp and mode)
  adb sync [ <directory> ]     - copy host->device only if changed
                                 (-l means list but don't copy)
  adb shell [-e escape] [-n] [-Tt] [-x] [command]
                               - run remote shell command (interactive shell if
no command given)
                                 (-e: choose escape character, or "none"; defaul
t '~')
                                 (-n: don't read from stdin)
                                 (-T: disable PTY allocation)
                                 (-t: force PTY allocation)
                                 (-x: disable remote exit codes and stdout/stder
r separation)
  adb emu <command>            - run emulator console command
  adb logcat [ <filter-spec> ] - View device log
  adb forward --list           - list all forward socket connections.
                                 the format is a list of lines with the followin
g format:
                                    <serial> " " <local> " " <remote> "\n"
  adb forward <local> <remote> - forward socket connections
                                 forward specs are one of:
                                   tcp:<port>
                                   localabstract:<unix domain socket name>
                                   localreserved:<unix domain socket name>
                                   localfilesystem:<unix domain socket name>
                                   dev:<character device name>
                                   jdwp:<process pid> (remote only)
  adb forward --no-rebind <local> <remote>
                               - same as 'adb forward <local> <remote>' but fail
s
                                 if <local> is already forwarded
  adb forward --remove <local> - remove a specific forward socket connection
  adb forward --remove-all     - remove all forward socket connections
  adb reverse --list           - list all reverse socket connections from device

  adb reverse <remote> <local> - reverse socket connections
                                 reverse specs are one of:
                                   tcp:<port>
                                   localabstract:<unix domain socket name>
                                   localreserved:<unix domain socket name>
                                   localfilesystem:<unix domain socket name>
  adb reverse --no-rebind <remote> <local>
                               - same as 'adb reverse <remote> <local>' but fail
s
                                 if <remote> is already reversed.
  adb reverse --remove <remote>
                               - remove a specific reversed socket connection
  adb reverse --remove-all     - remove all reversed socket connections from dev
ice
  adb jdwp                     - list PIDs of processes hosting a JDWP transport

  adb install [-lrtsdg] <file>
                               - push this package file to the device and instal
l it
                                 (-l: forward lock application)
                                 (-r: replace existing application)
                                 (-t: allow test packages)
                                 (-s: install application on sdcard)
                                 (-d: allow version code downgrade (debuggable p
ackages only))
                                 (-g: grant all runtime permissions)
  adb install-multiple [-lrtsdpg] <file...>
                               - push this package file to the device and instal
l it
                                 (-l: forward lock application)
                                 (-r: replace existing application)
                                 (-t: allow test packages)
                                 (-s: install application on sdcard)
                                 (-d: allow version code downgrade (debuggable p
ackages only))
                                 (-p: partial application install)
                                 (-g: grant all runtime permissions)
  adb uninstall [-k] <package> - remove this app package from the device
                                 ('-k' means keep the data and cache directories
)
  adb bugreport [<zip_file>]   - return all information from the device
                                 that should be included in a bug report.

  adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]
[-system|-nosystem] [<packages...>]
                               - write an archive of the device's data to <file>
.
                                 If no -f option is supplied then the data is wr
itten
                                 to "backup.ab" in the current directory.
                                 (-apk|-noapk enable/disable backup of the .apks
 themselves
                                    in the archive; the default is noapk.)
                                 (-obb|-noobb enable/disable backup of any insta
lled apk expansion
                                    (aka .obb) files associated with each applic
ation; the default
                                    is noobb.)
                                 (-shared|-noshared enable/disable backup of the
 device's
                                    shared storage / SD card contents; the defau
lt is noshared.)
                                 (-all means to back up all installed applicatio
ns)
                                 (-system|-nosystem toggles whether -all automat
ically includes
                                    system applications; the default is to inclu
de system apps)
                                 (<packages...> is the list of applications to b
e backed up.  If
                                    the -all or -shared flags are passed, then t
he package
                                    list is optional.  Applications explicitly g
iven on the
                                    command line will be included even if -nosys
tem would
                                    ordinarily cause them to be omitted.)

  adb restore <file>           - restore device contents from the <file> backup
archive

  adb disable-verity           - disable dm-verity checking on USERDEBUG builds
  adb enable-verity            - re-enable dm-verity checking on USERDEBUG build
s
  adb keygen <file>            - generate adb public/private key. The private ke
y is stored in <file>,
                                 and the public key is stored in <file>.pub. Any
 existing files
                                 are overwritten.
  adb help                     - show this help message
  adb version                  - show version num

scripting:
  adb wait-for[-<transport>]-<state>
                               - wait for device to be in the given state:
                                 device, recovery, sideload, or bootloader
                                 Transport is: usb, local or any [default=any]
  adb start-server             - ensure that there is a server running
  adb kill-server              - kill the server if it is running
  adb get-state                - prints: offline | bootloader | device
  adb get-serialno             - prints: <serial-number>
  adb get-devpath              - prints: <device-path>
  adb remount                  - remounts the /system, /vendor (if present) and
/oem (if present) partitions on the device read-write
  adb reboot [bootloader|recovery]
                               - reboots the device, optionally into the bootloa
der or recovery program.
  adb reboot sideload          - reboots the device into the sideload mode in re
covery program (adb root required).
  adb reboot sideload-auto-reboot
                               - reboots into the sideload mode, then reboots au
tomatically after the sideload regardless of the result.
  adb sideload <file>          - sideloads the given package
  adb root                     - restarts the adbd daemon with root permissions
  adb unroot                   - restarts the adbd daemon without root permissio
ns
  adb usb                      - restarts the adbd daemon listening on USB
  adb tcpip <port>             - restarts the adbd daemon listening on TCP on th
e specified port

networking:
  adb ppp <tty> [parameters]   - Run PPP over USB.
 Note: you should not automatically start a PPP connection.
 <tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
 [parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
  <localdir> can be interpreted in several ways:

  - If <directory> is not specified, /system, /vendor (if present), /oem (if pre
sent) and /data partitions will be updated.

  - If it is "system", "vendor", "oem" or "data", only the corresponding partiti
on
    is updated.

internal debugging:
  adb reconnect                  Kick current connection from host side and make
 it reconnect.
  adb reconnect device           Kick current connection from device side and ma
ke it reconnect.
environment variables:
  ADB_TRACE                    - Print debug information. A comma separated list
 of the following values
                                 1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
  ANDROID_SERIAL               - The serial number to connect to. -s takes prior
ity over this if given.
  ANDROID_LOG_TAGS             - When used with the logcat option, only these de
bug tags are printed.

Which tells me something went wrong with the syntax. As far as I can tell, the syntax is correct though. Any ideas?

asked 9 secs ago

Let's block ads! (Why?)



How to Modify/PUSH AVD Host File from Windows Command Prompt?

Alternative to cursor when applying a list of values to a where clause?

Vote count: 0

What's an alternative to getting a distinct number of dates, say all the dates for September:

9/1/2016
9/2/2016
9/3/2016

and apply each value to a query. Say something like:

Select GuitarId,GuitarBrand
From GuitarSales
Where GuitarDate = @date

I don't want to use a cursor, is there an alternative to doing this?

I tried a CTE but even then I'd have to apply the cursor for each date.

asked 24 secs ago

Let's block ads! (Why?)



Alternative to cursor when applying a list of values to a where clause?

Copy from one sheet to another workbook based on multiple criteria VBA Excel

Vote count: 0

I have two diffrent workbooks, From one of them i want to copy certain value based on multiple criteria.

In this example i will call each workbook wb1 and wb2. There will be shared wb links in the end of the post as example to make it more clear how it looks..

So in wb1 i have a list of names that also have their own sheet in wb2. When i open wb1 i want to copy the value under cell called "NPS" to each sheet in wb2 with the same name, In wb2 i have different month and a few other varibles that i have to add manual. So what i want it to do is copy value from NPS to the data under NPS and match it with the same Month that is also mentioned in wb1.

What i have so far is this code, but it doesnt realy make it.. Since i get an "subsribtion out of range" on this part Set sh2 = wb2.Sheets(c.Value). what im guessing is that it cant identify the sheets by the value even tho its named exaclty the same.

Sub NPS()
Dim sh1 As Worksheet, sh2 As Worksheet, c As Range, wb2 As Workbook, fn As Range
Set sh1 = ThisWorkbook.ActiveSheet
Set wb2 = Workbooks.Open("F:\Excel\Chef\NPS Samtal 777 agentnivå.xlsx")
    For Each c In sh1.Range("C8", sh1.Cells(Rows.Count, 3).End(xlUp))
        Set sh2 = wb2.Sheets(c.Value)
        Set fn = sh2.Rows(24).Find(sh1.Range("B5").Value, , xlValues, xlWhole)
        If Not fn Is Nothing Then
               fn.Offset(1) = sh1.Range("E5").Value
        End If
    Next
End Sub

WB1: http://ift.tt/2dsDtgj

WB2: http://ift.tt/2dKRBN4

IF anyone have any suggestions i would be very pleased.

//regards Daniel

asked 27 secs ago

Let's block ads! (Why?)



Copy from one sheet to another workbook based on multiple criteria VBA Excel

Selenium Traverse Up the DOM an unknown length in Java

Vote count: 0

I've got a web page that dynamically generates content. As a result, I don't know far up the tree I need to travel, but I know the id of a target child element. I would like to travel up and find the first h1 tag above it, I simply don't know how far up I have to go to access the h1 tag, but I know it will be an xxxxParent of the tag. Is there an efficient way to achieve this?

asked 17 secs ago

Let's block ads! (Why?)



Selenium Traverse Up the DOM an unknown length in Java

Send data from one Wemos to another

Vote count: 0

I have 2 Wemos d1(retired) boards. I just simply need to send some data or a letter from one to the other. I searched the web deeply and found some complicated NodeMCU stuff and so on. Even though I could send data when I flashed NodeMCU to my Wemos,it was useless because my project is about arduino. I need to work Arduino IDE. There was a way to create a WebServer on one of the wemos and then deal with html files. But isn't it so complicated for just sending a couple of bytes. i don't need any webserver or html page. So please help me.

asked 22 secs ago

Let's block ads! (Why?)



Send data from one Wemos to another

Errors while compiling the generated C++ SDK

Vote count: 0

I have installed the kaa server and did a compilation of a SDK i generated, first everything went well but after i changed the IP settings in the administrative GUI of the kaa-server things went wrong.

The C++ SDK wont compile anymore and gives the following error:

In file included from kaa/IKaaClientStateStorage.hpp:24:0,
                 from kaa/channel/transport/IKaaTransport.hpp:20,
                 from kaa/channel/transport/AbstractKaaTransport.hpp:20,
                 from kaa/event/registration/UserTransport.hpp:22,
                 from /impl/event/registration/UserTransport.cpp:17:
kaa/notification/gen/NotificationDefinitions.hpp:34:27: error: ‘Notification’ in namespace ‘kaa_notification’ does not name a type
 typedef kaa_notification::Notification KaaNotification;

asked 31 secs ago

Let's block ads! (Why?)



Errors while compiling the generated C++ SDK

IBM Watson Visual Recognition JAVA SDK - How do I update a classifier with a new class?

Vote count: 0

Having trouble adding a new class to a classifier, not sure of the method that is needed to do it so I'm calling the request the same way as I created the classifier but It's returning the below error:

SEVERE: POST http://ift.tt/2dfpJA2, status: 400, error: Cannot execute learning task  : this plan instance can have only 1 custom classifier(s), and 1 already exist.

This is my code when I created the new classifier:

File negativeEx = new File(".../negative.zip");
    File classPositives = new File(".../positives.zip");

    ClassifierOptions options = new ClassifierOptions.Builder().classifierName(classifier).negativeExamples(negativeEx)
            .addClass("my_new_class", classPositives).build();



    VisualClassifier result;
    result = service.createClassifier(options).execute();

    System.out.println(result);

asked 34 secs ago

Let's block ads! (Why?)



IBM Watson Visual Recognition JAVA SDK - How do I update a classifier with a new class?

Space Invaders game shows empty window after compilation and "Exception in thread" error in console

Vote count: -1

Trying to write Space Invaders game.

You can see my code for this app on GitHub.

I using this tutorial and complete first 14 lessons and all was OK, program compiled without errors and run correctly. But after video 15 program stop working correctly and shows following errors in console:

Exception in thread "Thread-3" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at spaceinvaders.sprite.SpriteAnimation.draw(SpriteAnimation.java:37)
at spaceinvaders.enemytypes.EnemyTypeBasic.draw(EnemyTypeBasic.java:43)
at spaceinvaders.levels.Level1.draw(Level1.java:33)
at spaceinvaders.gamescreen.GameScreen.draw(GameScreen.java:32)
at spaceinvaders.state.StateMachine.draw(StateMachine.java:23)
at spaceinvaders.display.Display.draw(Display.java:104)
at spaceinvaders.display.Display.run(Display.java:86)
at java.lang.Thread.run(Thread.java:745)

Please, help me find reason of this error and fix this.

This pic shows how game works before video 15 enter image description here

This pic shows how game works after video 15 enter image description here

asked 2 mins ago

Let's block ads! (Why?)



Space Invaders game shows empty window after compilation and "Exception in thread" error in console

Jquery Tabs is throwing error or is not working

Vote count: 0

I am trying to change the default tab to the active tab after I save the page so the client doesn't get mad.

I am using this code:

<cfif isDefined('url.activePage')>
<script>
    <cfoutput>
        var #toScript(url.activePage,'activeTab')#;
    </cfoutput>
    $(document).ready(function () {
        var index = $('.tabs a[href="#'+activeTab+'"]').parent().index();
        $(".tabs").tabs("option", "active", index);
    });
</script>

It is giving me this error:

Uncaught error: cannot call methods on tabs prior to initialization; attempted to call method 'option'

I edit my code to this:

$(".tabs").tabs({active:index});

It doesn't throw an error anymore, but it's not loading my active tab.

What am I doing wrong?

asked 2 mins ago

Let's block ads! (Why?)



Jquery Tabs is throwing error or is not working

target-platform-configuration selects incorrect environment

Vote count: 0

I'm attempting to build an group of Eclipse features using Tycho (0.20.0) on a Windows machine. However, the Maven build fails on the update site because Tycho seemingly thinks that it is running on 64-bit Linux, and not Windows.

[INFO] {osgi.ws=gtk, osgi.os=linux, osgi.arch=x86_64, org.eclipse.update.install.features=true}

I would expect:

[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86, org.eclipse.update.install.features=true}

It's my understanding that Tycho gets the platform information based on where it is run (as per Tycho Properties). If that's the case, is this a bug in Tycho since I'm not actively telling it the current platform?

If I comment out the Linux environment, it falls back on the 32-bit Linux, and if I comment THAT out, it selects the Mac OSX environment. As a workaround, I've just been commenting out all but the Windows environments, however I'd really like to understand why this is an issue.

To add to the confusion, I have other similar projects with identical sets of plugins in the pom files, and those builds execute without a problem.

The expanded Maven output below shows that it's complaining about not being able to locate org.eclipse.swt.internal.win32, however I'm fairly certain this isn't the root issue since the build is successful when the correct environment is chosen by Tycho.

Any thoughts on why Tycho would be selecting anything BUT a Windows environment?


In the root pom.xml:

<executions>
    ...
    <execution>
        <id>assemble-update-site</id>
        <phase>package</phase>
        <goals>
            <goal>run</goal>
        </goals>
        <configuration>
            <encoding>UTF-8</encoding>
            <projectsDirectory>update-site</projectsDirectory>
            <pomIncludes>
                <pomInclude>pom.xml</pomInclude>
            </pomIncludes>
            <goals>
                <goal>clean</goal>
                <goal>package</goal>
            </goals>
        </configuration>
    </execution>
    ...
</executions>

Both the update-site and parent pom.xml contain this set of plugins:

...
<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>${tycho-version}</version>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho-version}</version>
            <configuration>
                <environments>
                    <environment>
                        <os>macosx</os>
                        <ws>cocoa</ws>
                        <arch>x86_64</arch>
                    </environment>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86</arch>
                    </environment>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86_64</arch>
                    </environment>
                    <environment>
                        <os>linux</os>
                        <ws>gtk</ws>
                        <arch>x86_64</arch>
                    </environment>
                    <environment>
                        <os>linux</os>
                        <ws>gtk</ws>
                        <arch>x86</arch>
                    </environment>
                </environments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-publisher-plugin</artifactId>
            <version>${tycho-version}</version>
            <configuration>
                <publishArtifacts>true</publishArtifacts>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-director-plugin</artifactId>
            <version>${tycho-version}</version>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-repository-plugin</artifactId>
            <version>${tycho-version}</version>
            <configuration>
                <includeAllDependencies>false</includeAllDependencies>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.5</version>
        </plugin>
    </plugins>
</build>
...

More context for the Maven output:

...
[INFO] --- maven-invoker-plugin:1.5:run (assemble-update-site) @ some.feature.repo.aggregate.pom ---
[WARNING] Filtering of parent/child POMs is not supported without cloning the projects
[INFO] Building: pom.xml
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: com.example.app:some.feature.repository:1.0.0-SNAPSHOT @ C:\workspace\some-project\features\update-site\interpolated-pom.xml
[INFO] Adding repository file:C:/workspace/some-project/features/update-site/../some.other.feature/target/site
... more repositories ...
[INFO] Resolving dependencies of MavenProject: com.example.app:some.feature.repository:1.0.0-SNAPSHOT @ C:\workspace\some-project\features\update-site\interpolated-pom.xml
[INFO] Cannot complete the request.  Generating details.
[INFO] Cannot complete the request.  Generating details.
[INFO] {osgi.ws=gtk, osgi.os=linux, osgi.arch=x86_64, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: some.feature.repository raw:1.0.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.0.0-SNAPSHOT
[ERROR]   Missing requirement: com.example.app.some.dependency 2.2.0.GA requires 'package org.eclipse.swt.internal.win32 0.0.0' but it could not be found
[ERROR]   Cannot satisfy dependency: some.feature.repository raw:1.0.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.0.0-SNAPSHOT depends on: some.feature.group [1.0.0,1.0.1)
[ERROR]   Cannot satisfy dependency: some.feature.group 1.0.0.201610051537 depends on: com.example.app.some.dependency [2.2.0.GA]
...

asked 30 secs ago

Let's block ads! (Why?)



target-platform-configuration selects incorrect environment

Declaration is on valid at file scope (UI color extension)

Vote count: 0

Okay so I have an error with my extension, which whenever I add a line or space it up it creates more errors with the UIColor. I can use the Clean function to get it back down to these two errors. My extension is not in {} and I think I have all my blocks closed, but maybe not. It was working fine before I made 'FIRAuth Create User' function if that has anything to do with it. Issue Navigator + the Code

extension UIColor{

    convenience init (r: CGFloat, g: CGFloat, b: CGFloat) {
        self.init(red: r/255, green: g/255, blue: b/255, alpha: 1)
    }

}

asked 41 secs ago

Let's block ads! (Why?)



Declaration is on valid at file scope (UI color extension)

BALANCING A RED-BLACK TREE AFTER REMOVAL

Vote count: 0

JAVA: Red-Black Tree Remove Method

Please check this post out.

asked 10 secs ago

Let's block ads! (Why?)



BALANCING A RED-BLACK TREE AFTER REMOVAL

Non-existing picture appearing on table of contents

Vote count: 0

I'm having a problem with a Microsoft Word document. My document has at least 60 pictures thats why I have a table of contents for all those pictures. Recently I have replaced one of the images and now the table of contents is showing a reference to a picture that does not exist in the document. I cant find it anywhere.

enter image description here

This is what is happening. I have a reference to a Figure 11 that does not exist. I've already updated the entire document references and still no luck. I've also hold the Ctrl button and clicked on the referece wich leads to nowhere. Just for the record, I have the track changes setting on.

Does anyone know how to fix this?

asked 20 secs ago

Let's block ads! (Why?)



Non-existing picture appearing on table of contents

Android retaining information across fragments

Vote count: 0

I have five fragments a user can switch between. One of these fragments loads a list of users from the server to populate the UI list on the fragment. I need the list information to persist if a user swipes to a different fragment and then swipes back to the original. I do not want the fragment to reload the users every time a user leaves the fragment and goes back.

I am looking at setRetainInsance(true) and was wondering if this is possible solution? What would be the best way for the fragment to retain the information without being created from scratch each time.

I am using this to switch between fragements -getSupportFragmentManager().beginTransaction().replace(R.id.searchLayout, ratingFragment).commit();

asked 22 secs ago

Let's block ads! (Why?)



Android retaining information across fragments

Kolmogorov-Smirnov Tests for Laplace destribution R

Vote count: 0

I have a problem with ks function in R. I have a Laplace Distribution:

ldes <- function(y, a) {
  if(y < 0.5) 1/a*log(2*y, 2) 
  else  1/a*log(2*(1-y), 2)
}
a <- 1
set.seed(1)
y = runif(1000, 0, 1)
ld <- ldes(y, a)

So, I need to do the ks test, but can't find anything about second parameter that should be in there, like:

ks.test(my_lnorm, **plnorm**, mean = -5, sd = 5)

for Lognormal Destribution or:

ks.test(my_log, **plogis**, location = 2, scale = 3)

for Logistics Destribution

Thanks.

asked 24 secs ago

Let's block ads! (Why?)



Kolmogorov-Smirnov Tests for Laplace destribution R

how to calculate a weighted.mean with plyr on all columns in a data.frame?

Vote count: 0

just curious if there's a sneaky way to do this that i'm missing.

library(plyr)
library(data.table)

dfx <- data.frame(
  group = c(rep('A', 8), rep('B', 15), rep('C', 6)),
  sex = sample(c("M", "F"), size = 29, replace = TRUE),
  age = runif(n = 29, min = 18, max = 54) ,
  score = runif( n = 29 ) ,
  weight = sample( 0:1 , 29 , replace = TRUE )
)

dt_dfx <- as.data.table(dfx)

unweighted mean comparisons

# mean of all columns not specified in by=
dt_dfx[ , lapply( .SD , mean ) , by = .(sex,group) ]

# here's how to match the data.table unweighted mean
ddply(dfx, .(group,sex), numcolwise(mean))

not sure how to do this with plyr

# weighted.mean of all columns not specified in by=
dt_dfx[ , lapply( .SD , weighted.mean , weight ) , by = .(sex,group) ]

# easy way to match the data.table weighted.mean?

thanks all

asked 32 secs ago

Let's block ads! (Why?)



how to calculate a weighted.mean with plyr on all columns in a data.frame?

How can I get my Chromecast receiver listed on the app page after it's already been published?

Vote count: 0

My custom Chromecast receiver was originally published with the "Listing Details" toggled off in the Developer Console, so that it doesn't show up on http://ift.tt/1hKCXDG. Now, I'd like it to be listed, so I toggled the listing setting on and saved.

Listing Details toggled on

We waited two days in case maybe a cache just needed to be cleared on Google's side, but it still doesn't appear when searching the app name on the listing page. All of the listing metadata is correct. Unpublishing and re-publishing is only a last-resort option for me as this receiver is live and used by hundreds of consumers daily. Does anyone have a solution for this?

asked 47 secs ago

Let's block ads! (Why?)



How can I get my Chromecast receiver listed on the app page after it's already been published?

Linking to a certain position of another page

Vote count: 0

I have a mainpage called index.html with a menu linking to certain positions (parts) on this mainpage. This is done via the variable 'data-slide' (see below) that is behind the 'buttons' in the menu. This works well on the mainpage. However, how can I do this when I'm on another html page than the mainpage, jumping to a certain position (part) of the mainpage?

    <div id="nav" class="right">
        <ul class="navigation">
            <li data-slide="1">Home</li>
            <li data-slide="2">Products</li>
            <li data-slide="4">Trade fairs</li>
            <li data-slide="6">Company</li>
            <li data-slide="8">Careers</li>
            <li data-slide="10">Contact</li>
            <li class="clear"></li>
        </ul>
    </div>

Javascript:

var links = $('.navigation').find('li');
slide = $('.slide');
button = $('.button');
mywindow = $(window);
htmlbody = $('html,body');

slide.waypoint(function (event, direction) {

    dataslide = $(this).attr('data-slide');

    if (direction === 'down') {
        $('.navigation li[data-slide="' + dataslide + '"]').addClass('active').prev().removeClass('active');
        $('.navigation li[data-slide="1"]').removeClass('active');
    }
    else {
        $('.navigation li[data-slide="' + dataslide + '"]').addClass('active').next().removeClass('active');
    }
});

mywindow.scroll(function () {
    if (mywindow.scrollTop() == 0) {
        $('.navigation li[data-slide="1"]').addClass('active');
        $('.navigation li[data-slide="2"]').removeClass('active');
    }
});

function goToByScroll(dataslide) {
    var goal = $('.slide[data-slide="' + dataslide + '"]').offset().top;
    if (mywindow.scrollTop()<goal) {
        var goalPx = goal + 1;
    } else {
        var goalPx = goal - 1;
    }
    htmlbody.animate({
        scrollTop: goalPx
    }, 2500, 'easeInOutQuint');
}

links.click(function (e) {
    e.preventDefault();
    dataslide = $(this).attr('data-slide');
    goToByScroll(dataslide);
});

button.click(function (e) {
    e.preventDefault();
    dataslide = $(this).attr('data-slide');
    goToByScroll(dataslide);

});

asked 25 secs ago

Let's block ads! (Why?)



Linking to a certain position of another page

Dijkstra openmp code in c

Vote count: 0

Hi i work on openmp and want to test a code of dijkstra algorithm.The code is heredijkstra_openmp .This code is written by John Burkardt and i try to run it.But run time for 1 thread is same by four thread.I have a intel core i3 system that can support 4 threads.I need a test case for it to estimate speed up of code. Available test case is too small.

asked 25 secs ago

Let's block ads! (Why?)



Dijkstra openmp code in c

Capturing Group Regex Javascript match returns two values why?

Vote count: 0

Why does "abcabcabc".match(/(abc){3}/);

return two entries ["abcabcabc", "abc"]? both "abcabcabc" and "abc"

similarly,

["1234", "1234"]

asked 13 secs ago

Let's block ads! (Why?)



Capturing Group Regex Javascript match returns two values why?

What does adding the oplogReplay option do for a tailable cursor in mongodb? Why did it fix my timeout issue?

Vote count: 0

I was trying to tail the oplog in mongo and was getting a timeout error. The oplog collection has over 7 millions documents in it. However, as a last ditch effort I added the option oplogReplay: true to the cursor options and the timeout error went away and I was reading the oplog stream.

The nodejs mongo docs are pretty cryptic about what this option actually does, only that it's for tailable cursors which is why I over looked it:

oplogReplay {Boolean}, sets an internal flag, only applicable for tailable cursor.

My guess is it either skips the initial scan of the whole oplog and goes right to the end, or it scans from the other end of the oplog.

My code looks something like this:

const tstamp = new MongoDB.Timestamp(0, Math.floor(new Date().getTime() / 1000));
const filters = {
  ts: { $gt: tstamp }
};
const curOpts = {
    tailable: true,
    timeout: false,
    oplogReplay: true,  //<- What does this actually do?
    awaitData: true,
    numberOfRetries: 60 * 60 * 24,
    tailableRetryInterval: 1000
};

mongodb.connect(url).then(db => {
    const cur = db.collection('oplog.rs').find(filters, curOpts);
    const stream = cur.stream();
    stream
      .on('data', log => {
        console.log('Data!')
        console.log(log)
      })
      .on('close', () => {
        console.log('Stream closed....')
        db.close()
      })
      .on('error', err => {
        console.log('Stream error....')
        console.error(err)
        db.close()
      });
}));

Related reseach

I also found this question and answer which is related. I found that after I solved my original issue though.

And when I was researching the problem, I found that the oplog scan times out after 30 seconds and this is/was causing issues from some.

Another question and answer related to my timeout issue. It seems that creating an index on the ts field of the oplog is a very bad idea and impossible on newer versions of mongo.

asked 40 secs ago

Let's block ads! (Why?)



What does adding the oplogReplay option do for a tailable cursor in mongodb? Why did it fix my timeout issue?

Insert data into columns with value "NULL" in SQL server

Vote count: 0

I added additional columns to my "Customer" table without giving them a value. Now I'm trying to add data into those columns containing "NULL" as the default. I have tried using "select Account_Number,ISNULL(Employer,'Some Company')AS Employer from Customer" and "update Customer set Employer='Some Company' where Account_Number = '123456'" but nothing happens. How can i avoid having to use "Edit Top 200 Rows" to do this?

asked 37 secs ago

Let's block ads! (Why?)



Insert data into columns with value "NULL" in SQL server

How to stream video from my android phone to web

Vote count: 0

I want this to implement it in android native.

Suggest me on how to proceed to get this done.

Also share if you have any GitHub repo.

asked 43 secs ago

Let's block ads! (Why?)



How to stream video from my android phone to web

Java Method Variable Trouble

Vote count: 0

I am currently working on a brickbreaker game in Java that uses objects as each individual brick. In the method I use to check if the ball has hit a brick, I change the ball's Y Velocity so that it "bounces" off the brick. I'm having trouble with the communication of the Y velocity variable between my run method and check method. I use a System.out.println(yBallVel); statement in both methods and I get different values for the same variable, even though the method is called just prior to the SOP in my animation method. My Code is below. Please explain why the two variables have different values, and how I can get the check method to change the global value of the yBallVel variable. Thanks.

import java.util.*;
import javax.swing.*;
import java.awt.*; 
import java.awt.event.*;
import java.io.*;
import java.net.URL;
import javax.sound.sampled.*;
public class Lemon5 extends JFrame implements Runnable, KeyListener{
int xbox;
int ybox;
static Lemon5 box1 = new Lemon5();
static Lemon5 box2 = new Lemon5();
Container con = getContentPane();
Thread t = new Thread(this);
int xPaddleLoc;
int yPaddleLoc;
int xBallLoc;
int yBallLoc;
int xBallVel;
int yBallVel;
int xBallBottomLoc;
int yBallBottomLoc;
boolean draw;

public void boxvalue(int xbox, int ybox){
this.xbox=xbox;
this.ybox=ybox;
}
public Lemon5()
{
xPaddleLoc=270;
yPaddleLoc=530;
xBallLoc=100;
yBallLoc=400;
xBallVel=0;
yBallVel=-5;
draw=true;

xBallBottomLoc=xBallLoc+25;
yBallBottomLoc=yBallLoc+50;
con.setLayout(new FlowLayout());
addKeyListener(this);
setDefaultCloseOperation(EXIT_ON_CLOSE);
t.start();
}
public void check(int yBallVel){
if(xBallBottomLoc>=this.xbox&&xBallBottomLoc<=this.xbox+75
&&yBallLoc<=this.ybox+    75){
yBallVel=500;
System.out.println(yBallVel);
}

}
public void run()
{
try{
while(true)
{
xBallBottomLoc=xBallLoc+25;
yBallBottomLoc=yBallLoc+50;
if(xPaddleLoc<0){//Left Paddle Threshold
xPaddleLoc=0;
}
if(xPaddleLoc>500){//Right Paddle Threshold
xPaddleLoc=500;
}
if(xBallLoc<=0){//Left Wall Bounce
xBallVel=10;
}
if(xBallLoc>=550){//Right Wall Bounce
xBallVel=-10;
}
if(yBallLoc<=0){//Top Bounce
yBallVel=5;
}
if(yBallBottomLoc==yPaddleLoc&&xBallBottomLoc<=
xPaddleLoc+100&&xBallBottomLoc>=x    PaddleLoc){//Paddle Bounce
yBallVel=-5;
}
box1.check(yBallVel);
System.out.println("asdf "+yBallVel);
xBallLoc=xBallLoc+xBallVel;
yBallLoc=yBallLoc+yBallVel;
t.sleep(17);
repaint();
}
}
catch(Exception e)
{
e.printStackTrace();
}

asked 16 secs ago

Let's block ads! (Why?)



Java Method Variable Trouble

find specific folder in any mapped drive and report its full UNC path

Vote count: 0

I was wondering if it was possible using a batch file to find a specific folder in any mapped drive of a PC and have it report the folders full UNC path. Lets say a PC has drives mapped of N:\ & S:\ (or any usual network drive letter for that matter). The folder could be in either folder and I run some code to find where the folder is, it will be in the root of the drive share (avoiding need for recursive subfolder scanning) e.g. N:\Special_Folder however, the end result of the code will report the FULL UNC e.g.

Folder Found!..

\server-vm01\data\shared_area\special_folder

Hope that makes sense. I have tried with some code I already use to identify a USB stick, but am having difficulty porting it to the needs above. Any pointers would be great, thank you.

for %%a in (d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) do | find "special_folder" >nul && set unc=%%a:
echo %unc%
pause

asked 17 secs ago

Let's block ads! (Why?)



find specific folder in any mapped drive and report its full UNC path

d3js v4 parseTime returns null

Vote count: 0

I followed this d3js (version 4) tutorial: http://ift.tt/2biGU5i

It works perfectly except for this line:

d.date = parseTime(d.date);

parseTime would return null.

I know I can get the date also with new Date(d.date). But out of curiosity I'd like to know why parseTime doesn't work for me.

asked 20 secs ago

Let's block ads! (Why?)



d3js v4 parseTime returns null

creatign own _id while PUT to elasticsearch

Vote count: 0

I am new to elasticsearch and I am not sure why I am getting this message when I try to post some data. I want to create my own ID's so I generated my own UUIDs.

$ curl -XPUT http://{IP}:{PORT}/tracer/poster/b9d9fj2c-69ea-47f0-94e1-a6a3caecd097?pretty -d {"test": 1}
{
  "error" : {
    "root_cause" : [ {
      "type" : "mapper_parsing_exception",
      "reason" : "failed to parse"
    } ],
    "type" : "mapper_parsing_exception",
    "reason" : "failed to parse",
    "caused_by" : {
      "type" : "json_e_o_f_exception",
      "reason" : "Unexpected end-of-input within/between Object entries\n at [Source: org.elasticsearch.common.io.stream.InputStreamStreamInput@572153d0; line: 1, column: 13]"
    }
  },
  "status" : 400
}

asked 30 secs ago

Let's block ads! (Why?)



creatign own _id while PUT to elasticsearch

Why is my website not displaying properly in internet explorer?

Vote count: 0

My website http://shapies.com displays properly in other browsers except Internet Explorer.

In other browsers diifferent colours appear in full but in Internet Explorer the website is just black.

Kindly assist on how to fix this.

Google Chrome render on the left and Internet Explorer render on the right

asked 14 secs ago

Let's block ads! (Why?)



Why is my website not displaying properly in internet explorer?

Selenium:Error communicating with the remote browser. It may have died

Vote count: 0

Using Selenium and trying to just do a simple test but get following message:

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died. Build info: version: 'unknown', revision: 'c7b525d', time: '2016-09-01 14:52:30 -0700' System info: host: 'LPT-ANJA01', ip: '10.63.20.166', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101' Driver info: driver.version: RemoteWebDriver

I am extending a base class that just open a webpage. But then nothing happens.

Baseclass:

import java.util.concurrent.TimeUnit;

import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;

public class BaseClass {
     WebDriver driver;

        @Before
        public void setUp() {

            System.setProperty("webdriver.gecko.driver","C:\\Selenium\\geckodriver.exe");

            ProfilesIni allProfiles = new ProfilesIni();
            FirefoxProfile myProfile = allProfiles.getProfile("default");
            myProfile.setAcceptUntrustedCertificates(true);
            myProfile.setAssumeUntrustedCertificateIssuer(true);
            driver = new FirefoxDriver(myProfile);

            driver.manage().window().maximize();

            driver.get("http://blahbal.com");



            }



        @After
        public void closeApplication(){

            driver.quit();

        }

}

And the test class:

import static org.junit.Assert.*;

import java.util.concurrent.TimeUnit;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class AssertTitleTest extends BaseClass {


    @Test
    public void test() {
        System.out.println(driver.getTitle());


    }

}

asked 16 secs ago

Let's block ads! (Why?)



Selenium:Error communicating with the remote browser. It may have died

Finding crx files of extensions in chrome for usage with selenium in Chrome through python

Vote count: 0

Using Selenium (with Chrome) through python 3, my goal is to enable adblocker before starting my web scraping. I saw from this and this that the idea is to use:

    chop =webdriver.ChromeOptions()
    chop.add_extension(path.abspath('Adblock-Plus_v1.4.1.crx'))
    driver = webdriver.Chrome(chrome_options=chop)

But I do not understand how to find the path to the .crx file of adBlocker. I searched it in my computer and couldn't find it. Also, IU couldn't find this file by itself for download anywhere online. Any advice on how to find it or a different way to proceed for adblocking? Thanks

asked 37 secs ago

Let's block ads! (Why?)



Finding crx files of extensions in chrome for usage with selenium in Chrome through python

Codesys fatek programming

Vote count: 0

How can I write program in codesys (ST or IL) and put it on fatek FBs series PLC? It is posible? I was not use codesys before. I was using Ladder and other PLC (Omron, Unitronics, Simens, Schnider Electric).

asked 43 secs ago

Let's block ads! (Why?)



Codesys fatek programming

RxAndroidBle Scanning

Vote count: 0

I am trying to use the RxAndroidBle lib (http://ift.tt/1UU2YUJ) I want the app the start and scan for BLE devices. How can I do this?

    RxBleClient rxBleClient;
   RxBleScanResult rxBleScanResult;
   private Subscription scanSubscription;
 @Override
  protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
   rxBleClient = RxBleClient.create(this);



Subscription scanSubscription =rxBleClient.scanBleDevices().subscribe(rxBleScanResult.getBleDevice().getMacAddress() );


}

asked 15 secs ago

Let's block ads! (Why?)



RxAndroidBle Scanning

This pangram function in C++ doesn't satisfy all the test cases in HackerRank

Vote count: 0

I wanted to run a loop to check if every letter in the alphabet was present in the loop. If it was, I'd do an increment, and break the loop, so that it didn't read more than one time, in C++

    #include<iostream>
    using namespace std;
    class pangram                                          \\creating the class
    {
    string s;
    int count=0;                                           \\counter variable initialization
    public:
    void pan(void)                                         \\defining the method
        {
            cin>>s;                                         \\taking the string input
            for(char i='a';i<='z';i++)                       \\checking if every alphabet character is there in the string
                {
                    for(int j=0;j<s.length();j++)
                    {
                        char c=tolower(s[i]);                \\making them lowercase
                        if(i==c)
                        count++;
                        break;                               \\breaking the loop once that specific alphabet is found
                    }
                }
            if(count==26)
            cout<<"pangram";
            else
            cout<<"not pangram";
        }
    };
    pangram p1;
    int main()
    {
    p1.pan();                                            \\calling the object's method
    return 0;
    }

asked 19 secs ago

Let's block ads! (Why?)



This pangram function in C++ doesn't satisfy all the test cases in HackerRank

Are the strings in Algolia's highlightResult guaranteed html-safe?

Vote count: 0

I'm trying using Algolia instantSearch's highlightResult feature on a React web application. When the results displayed like <em>Re</em>sult, I realized that I would have to mark it as functional HTML using React's Dangerously Set innerHTML to get the tags to work like tags and not be escaped. I can't find a place where Algolia describes their policy for escaping characters in the index and results. I'd prefer not to have to use client-side sanitation to ensure that the only tags in the results are <em>, but I can't afford the possibility of a stored XSS attack. Is the highlightResult string returned by an Algolia search safe to use as HTML without sanitizing first?

asked 20 secs ago

Let's block ads! (Why?)



Are the strings in Algolia's highlightResult guaranteed html-safe?

Testing students' code in Jupyter with a unittest

Vote count: 0

I'd like my students to be able to check their code as they write it in a Jupyter Notebook by calling a function from an imported module which runs a unittest. This works fine unless the function needs to be checked against objects which are to be picked up in the global scope of the Notebook.

Here's my check_test module:

import unittest
from IPython.display import Markdown, display

def printmd(string):
    display(Markdown(string))

class Tests(unittest.TestCase):

    def check_add_2(self, add_2):
        val = 5
        self.assertAlmostEqual(add_2(val), 7)

    def check_add_n(self, add_n):
        n = 6
        val = 5
        self.assertAlmostEqual(add_n(val), 11)


check = Tests()
def run_check(check_name, func, hint=False):
    try:
        getattr(check, check_name)(func)
    except check.failureException as e:
        printmd('**<span style="color: red;">FAILED</span>**')
        if hint:
            print('Hint:',  e)
        return
    printmd('**<span style="color: green;">PASSED</span>**')

If the Notebook is:

In [1]: def add_2(val):
            return val + 2

In [2]: def add_n(val):
            return val + n

In [3]: import test_checks

In [4]: test_checks.run_check('check_add_2', add_2)
        PASSED

In [5]: test_checks.run_check('check_add_n', add_n)
        !!! ERROR !!!

The error here is not suprising: add_n doesn't know about the n I defined in check_add_n.

So I got to thinking I could do something like:

In [6]: def add_n(val, default_n=None):
            if default_n:
                n = default_n
            return val + n

in the Notebook, and then passing n in the test:

    def check_add_n(self, add_n):
        val = 5
        self.assertAlmostEqual(add_n(val, 6), 11)

But this is causing me UnboundLocalError headaches down the line because of the assignment of n, even within an if clause: this is apparently stopping the Notebook from picking up n in global scope when it's needed.

For the avoidance of doubt, I don't want insist that n is passed as an argument to add_n: there could be many such objects used but not changed by the function being tested and I want them resolved in the outer scope.

Any ideas how to go about this?

asked 38 secs ago

Let's block ads! (Why?)



Testing students' code in Jupyter with a unittest

I am trying to format a horizontal navigation list

Vote count: 0

So I want to format a horizontal navigation list. In my HTML page it says: <nav class="horizontal">

So in my css file I put this but it doesnt seem to work:

 Nav.Horizontal {
    background-color:rgb(0,0,0);
    color: rgb(255,255,255);
    font-weight: bold;
    font-size:10px;
    letter-spacing:3px;
}

a:Nav.Horizontal {
    color:rgb(255,0,0)
}

asked 24 secs ago

Let's block ads! (Why?)



I am trying to format a horizontal navigation list

Swift In App Purchases Tutorial, Confused over Button to Method Linking.

Vote count: 0

i am fairly new IOS developer, but have recently managed to get IAP working by following this tutorial.

http://ift.tt/25yjA8d

Now this all works, and items are displayed in a listview with a buy button generated when a item is detected as purchasable.

Now what I am confused about is the following:

1.How to induce the payment method from a seperate view controller, i can not see any calls to buy the product from the existing buttons?

2.How would they know what product i was wanting to buy, how is the product reference being passed through when buying a product.

Looking through the code i am struggling to understand these 2 vital elements.

Code attached below

Thanks

Product Cell class, appears to dynamically create buy button in the table view based on the products available from the store import UIKit import StoreKit

class ProductCell: UITableViewCell {
   static let priceFormatter: NumberFormatter = {
let formatter = NumberFormatter()

formatter.formatterBehavior = .behavior10_4
formatter.numberStyle = .currency

return formatter
  }()

  var buyButtonHandler: ((_ product: SKProduct) -> ())?

  var product: SKProduct? {
    didSet {
  guard let product = product else { return }

  textLabel?.text = product.localizedTitle

  if RageProducts.store.isProductPurchased(product.productIdentifier) {
    accessoryType = .checkmark
    accessoryView = nil
    detailTextLabel?.text = ""
  } else if IAPHelper.canMakePayments() {
    ProductCell.priceFormatter.locale = product.priceLocale
    detailTextLabel?.text = ProductCell.priceFormatter.string(from: product.price)

    accessoryType = .none
    accessoryView = self.newBuyButton()
  } else {
    detailTextLabel?.text = "Not available"
  }
}
   }

  override func prepareForReuse() {
super.prepareForReuse()

textLabel?.text = ""
detailTextLabel?.text = ""
accessoryView = nil
  }

  func newBuyButton() -> UIButton {
let button = UIButton(type: .system)
button.setTitleColor(tintColor, for: UIControlState())
button.setTitle("Buy", for: UIControlState())
button.addTarget(self, action: #selector(ProductCell.buyButtonTapped(_:)), for: .touchUpInside)
button.sizeToFit()

    return button
 }

  func buyButtonTapped(_ sender: AnyObject) {
buyButtonHandler?(product!)
  }
}

RageProducts, contains product identifiers for products in itunes connect

 import Foundation

 public struct RageProducts {

  public static let Item1 = "com.justlift.Recipe1"
  public static let Item2 = "com.justlift.Test"

 fileprivate static let productIdentifiers: Set<ProductIdentifier> =[RageProducts.Item1,Item2]

  public static let store = IAPHelper(productIds:  RageProducts.productIdentifiers)
     }

 func resourceNameForProductIdentifier(_ productIdentifier: String) -> String?     {
   return productIdentifier.components(separatedBy: ".").last
      }

asked 31 secs ago

Let's block ads! (Why?)



Swift In App Purchases Tutorial, Confused over Button to Method Linking.