Posts

Showing posts from January, 2013

sql - How to convert Row values into column which is containing string values? -

this table name table1 id | columnname | columnvalue ----------------------------------- 48 | vehicleno | abc-0134 48 | in-time | 10:00 48 | out-time | 11:00 and want result bellow: id | vehicleno | in-time | out-time 48 | abc-0134 | 10:00 | 11:00 please me desired result. one method using pivot . select [id], [vehicleno], [in-time], [out-time] (select id, columnname, columnvalue tablename) pivot (max(columnvalue) coulnname in([vehicleno], [in-time], [out-time])) piv

c# - TimeSelector detecting only PM instead of Am -

i have database table 2 columns time1 , time2 respectively.time1 contains 08:00 (08:00:00.000) , time2 contains 17:30(17:30:00.000) .time1 , time2 database field's datatype datetime have code like protected void txtdate_textchanged(object sender, eventargs e) { datetime time1 = datetime.parseexact(txtdate.text,"dd-mm-yyyy",cultureinfo.invariantculture); string time4 = time1.tostring("yyyy-mm-dd"); str = "select timein,timeout musterroll empcode='" + ddcode.selecteditem.text + "' , date='"+time4+"'"; dr = conn.query(str); if (dr.read()) { datetime time = dr.getdatetime(0); timeselector1.settime(time.hour, time.minute, timeselector1.ampm); datetime time2 = dr.getdatetime(1); timeselector2.settime(time2.hour, time2.minute, timeselector2.ampm); } } code works timeselector1 shows 20:00 instead of 08...

vhdl - Instantiating 4 bit Full Adder -

i'm having difficulty instantiating fa0 portion of code. i'm new vhdl maybe more answer help. this logic 4 module structural code component alu i'm working on. thank ----------------------------------------------------------------- -- 4-bit adder/subtractor module ----------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; entity addsub4 port (addl_subh : in std_logic; x, y : in std_logic_vector(3 downto 0); s : out std_logic_vector(3 downto 0); cout, ovf : out std_logic); end addsub4; architecture addsub4_arch of addsub4 component fa port (cin, x, y : in std_logic; s, cout : out std_logic); end component fa; -- let yhat denote signal after y xor addl_subh signal yhat: std_logic_vector(3 downto 0); -- let carryout denote cout signal each fa module signal carryout: std_logic_vector(3 downto 0); begin yhat(0) <= y(0) ...

c++ - Are references or pointers faster? -

from know, references name variable whilst pointers own variable. pointers take space. people "use reference or pointer" don't better. if references take no memory of own, references win in department. don't know if compiler makes distinction between references , normal variable. if operations on reference, compile same code normal variable? internally references implemented in terms of pointer. so, it's difficult faster pointer/reference. it's usage of these 2 makes difference. for example want pass reference parameter function. void func(int& a) case_1 { //no need check null reference... } void func(int* a) case_2 { //need o check if pointer not null } in case_2 have explicitly check if pointer not null before dereferncing whereas that's not case references because references initialized something. assumption playing game in civilized manner i.e you not doing like:- int*p = null; int &a = *p;

c# - Error in asp.net webservice -

my asmx webservice this using system; using system.collections.generic; using system.data; using system.web; using system.web.script.services; using system.web.services; using newtonsoft.json; [webservice(namespace = "http://tempuri.org/")] [webservicebinding(conformsto = wsiprofiles.basicprofile1_1)] [scriptservice] public class getraterequestdata : webservice { [webmethod] [scriptmethod(responseformat = responseformat.json)] public string getparcellookupdata() { return jsonconvert.serializeobject(dataset, formatting.indented); } } and trying access data in browser this http://localhost:53569/services/getraterequestdata.asmx/getparcellookupdata/ but throws error like system.invalidoperationexception: getparcellookupdata/ web service method name not valid. @ system.web.services.protocols.httpserverprotocol.initialize() @ system.web.services.protocols.serverprotocolfactory.create(type type, httpcontext context, http...

ios8 - Unsupported URL error using Swift and opening custom URL scheme -

i'm working spotify ios sdk , , trying relaunch app after authenticating user. using custom url scheme, i'm able have app relaunched, i'm getting error in callback function i'm not receiving session data user. error is: error domain=nsurlerror here's i'm capturing error , printing console: func application(application: uiapplication, openurl url: nsurl, sourceapplication: string?, annotation: anyobject?) -> bool { var authcallback: sptauthcallback = { (error: nserror!, session: sptsession!) in if (error != nil) { println("there's error \(error)") return } } here's full text of error message: error domain=nsurlerrordomain code=-1002 "unsupported url" userinfo=0x7f97931069a0 {nslocalizeddescription=unsupported url, nsunderlyingerror=0x7f979140a610 "unsupported url"} fwiw, same method seems work fine in objective-c demo apps spotify provides, i'm...

Problems with here docs/strings in Android implementations of bash/mksh -

i've encountered several issues process substitution , here docs/strings in bash , mksh shells on android. process substitution in bash fails both privileged , unprivileged users. $ cat < <(ls) bash: /dev/fd/62: no such file or directory bash's man page states: process substitution supported on systems support named pipes (fifos) or /dev/fd method of naming open files. android lacks /dev/fd can resolve issue running following command su (or placing in userinit.d run upon boot): ln -s /proc/self/fd /dev/fd this sort of process substitution not supported in mksh, can around using named pipes, file descriptors, , here docs/strings. here docs/strings function in both bash , mksh while run root/su. herein lies problem: here docs/strings fail unprivileged users in both bash , mksh $ cat <<< "string" bash: cannot create temp file here-document: permission denied $ cat <<< "string" /system/bin/sh: can't create t...

php - How does Symfony2 passes the parameter of a URI to the controller Action method? -

i have started learning symfony2. came across doubt: if have route: # app/config/routing.yml hello: path: /hello/{name} defaults: { _controller: acmehellobundle:hello:index } and controller: // src/acme/hellobundle/controller/hellocontroller.php namespace acme\hellobundle\controller; use symfony\component\httpfoundation\response; class hellocontroller { public function indexaction($name) { return new response('<html><body>ciao '.$name.'!</body></html>'); } } internally symfony2 (inside app/bootstrap.php.cache) calls call user_func_array() php built-in function: $arguments = $this->resolver->getarguments($request, $controller); $response = call_user_func_array($controller, $arguments); and call getarguments() method returns array of arguments pass action method. if controller were: // src/acme/hellobundle/controller/hellocontroller.php namespace acme\hellobundle\controller; use symfony\comp...

my questions about Write a Java program to construct a LinkedList -

write java program construct linkedlist , following tasks: (a) insert 5 elements list. (b) add 1 node @ first position (c) add 1 node @ last position (d) add 1 node @ second position (e) print contents of list using listiterator. (f) remove first, third , last element list (g) change value of second node. (h) print list without using list iterator i think looking like: <code> linkedlist<string> linkedlist = new linkedlist<string>(); // add 5 elements linkedlist.add("item1"); linkedlist.add("item2"); linkedlist.add("item3"); linkedlist.add("item4"); linkedlist.add("item5"); system.out.println("list =["+linkedlist+"]"); /*add first*/ linkedlist.addfirst("item0"); system.out.println("list =["+linkedlist+"]"); //add last linkedlist.addlast("item6...

Cannot connect to Compute Engine instance via SSH in linux -

this question have answer before that's windows. in linux. i messed lot. please me solve issue. i created ssh pair using ssh-keygen command copied , pasted id_rsa.pub vminstace ssh keys , saved. issued below command that's not going gcloud compute --project "project001" ssh --zone "europe-west1-b" "instance-3" above command creates 2 file google_compute_engine , google_compute_engine.pub error : permission denied (publickey,gssapi-keyex,gssapi-with-mic). you have added ssh public key (id_rsa.pub) instance metadata , gcloud command has added other public key (google_compute_engine.pub) project metadata. however, instance metadata overrides project metadata trying ssh using non-authorized key. therefore, propose 4 different solutions case: 1- use standard ssh client: ssh -i $home/.ssh/id_rsa -o userknownhostsfile=/dev/null -o checkhostip=no -o stricthostkeychecking=no external_ip_address 2- add google_compute_e...

sqlalchemy + sqlite + multiprocessing gives DetachedInstance error - sometimes -

i have problem using sqlalchemy , multiprocessing sqlite. using default nullpool. create session in main process , pass multiple workers , entities passed workers through same queue. sporadically hit detached instance error inside workers,. workers , master share same session instance.i have tried several times reproduce, issue not reproducible @ will. suggestions on how attack issue helpful why don't use scoped session? http://docs.sqlalchemy.org/en/improve_toc/orm/contextual.html seems incapsulates creating of new session instance in each new thread (or process understand). check if helps you.

javascript - how do I store these three variables into local storage? -

i creating mad lib , can't variables store inside local storage. have 3 variables: noun, nountwo, , name. end goal once variables stored user able reload page , last story generated displayed @ top of page. <script> function lib() { var storydiv = document.getelementbyid("story"); var nountwo = document.getelementbyid("nountwo").value; var noun = document.getelementbyid("noun").value; var name = document.getelementbyid("name").value; storydiv.innerhtml = "one day " + noun + " attacked " + nountwo + ", , defeated " + name + "!"; noun.replace('noun', noun.value); noun.replace('nountwo', nountwo.value); noun.replace('name', name.value); } var libbtn = document.getelementbyid('generate'); libbtn.addeventlistener('click', lib); localstorage.setitem('noun', noun.valu...

regex - What is idiomatic clojure to validate that a string has only alphanumerics and hyphen? -

i need ensure input contains lowercase alphas , hyphens. what's best idiomatic clojure accomplish that? in javascript this: if (str.match(/^[a-z\-]+$/)) { ... } what's more idiomatic way in clojure, or if it, what's syntax regex matching? user> (re-matches #"^[a-z\-]+$" "abc-def") "abc-def" user> (re-matches #"^[a-z\-]+$" "abc-def!!!!") nil user> (if (re-find #"^[a-z\-]+$" "abc-def") :found) :found user> (re-find #"^[a-za-z]+" "abc.!@#@#@123") "abc" user> (re-seq #"^[a-za-z]+" "abc.!@#@#@123") ("abc") user> (re-find #"\w+" "0123!#@#@#abcd") "0123" user> (re-seq #"\w+" "0123!#@#@#abcd") ("0123" "abcd")

android - “Force Close Application” after enabling Proguard -

it working app out proguard now, enabled proguard , exported signed app using android-tools > export signed application then copied .apk on sd card , tried install on device. application stopped working my proguard.cfg code : -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose -dontoptimize -dontpreverify -keepattributes *annotation* -keep public class * extends android.app.activity -keep public class * extends android.app.application -keep public class * extends android.app.service -keep public class * extends android.content.broadcastreceiver -keep public class * extends android.content.contentprovider -keep public class * extends android.app.backup.backupagent -keep public class * extends android.preference.preference -keep public class * extends android.support.v4.app.fragment -keep public class * extends android.app.fragment -keepclasseswithmembernames class * { native <methods>; } -keep public class * extends android.view.view { ...

python - Bool array to integer -

is there build in function in python convert bool array (which represents bits in byte) so: p = [true, true, true, false, true, false, false, true] into byte array this: bp = bytearray([233]) i aware oh numpy looking within python itself this want: sum(v<<i i, v in enumerate(p[::-1]))

Android Fragment onCreateAnimator enter always true -

i facing problem on htc desire 4.0.3. animation enter, when fragment exiting....the problem doesnt exist on 4.4 or 5.0 public animator oncreateanimator(int transit, boolean enter, int nextanim) { animator anim; if (enter) { log.d("animation", "enter"); anim = enter_right_animator; } else { log.d("animation", "exit"); anim = exit_right_animator; } return anim; }

c++ - QTcpSocket Telnet readyRead returns rubbish -

i used realterm telnet device , works when try use qtcpsocket access it, rubbish data socket readall(), whats wrong??? qobject::connect(&sock, signal(readyread()), this, slot(readyread())); void qtelnet::readyread() { qbytearray ba = sock.readall(); qdebug() << "read:" << ba ; } output: "ÿýÿý ÿý#ÿý'" update: i called sock.connecttohost("192.168.80.17", 23); nothing else expected output follows: linux 2.4.31 (ntp001) (26) ntp001 login: if you're sure sent data valid string, try convert them one: qdebug() << "read:" << qstring(ba); otherwise, reason behind "rubbish" may simple that's data connecting client sent.

wpf - Checkbox with Catel EventToCommand not working in Datagrid -

i have following xaml: <datagrid.columns> </datatemplate> </datagridtemplatecolumn.headertemplate> <datagridtemplatecolumn.celltemplate> <datatemplate> <checkbox ischecked="{binding isselected, mode=twoway}" command="{binding datacontext.updatecommand, relativesource={relativesource mode=self}}"> </checkbox> </datatemplate> </datagridtemplatecolumn.celltemplate> </datagridtemplatecolumn> in viewmodels have; public command updatecommand { get; private set; } updatecommand = new command(updatecontrols); private void updatecontrols() { //execute } however, updatecontrols never executed. can me working ? the problem binding (which checkbox). should give datagrid name , use binding: <checkbox ischecked="{binding isselected, mode=twoway}" command="{binding elementname=mydatagrid, path=datacontext.updatecommand}" />

java - write the value at specific location of property file using servlet -

**************this controller(servlet)**************************** package com.igate.controller; import java.io.filenotfoundexception; import java.io.ioexception; import java.io.inputstream; import java.lang.reflect.method; import java.util.arraylist; import java.util.properties; import javax.servlet.requestdispatcher; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import org.apache.commons.configuration.configurationexception; import org.apache.commons.configuration.propertiesconfiguration; public class testcontroller extends httpservlet { private static final long serialversionuid = 1l; public testcontroller() { } protected void doget(httpservl...

arrays - jQuery ajax request to return data and repeat -

jquery code var seconds = 6; var timeout = seconds * 1000; function request() { $.ajax ({ url: "getdata.php", datatype: "json" }).done(function(data) { console.log(data); // check if json data returned php script // somehow put returned json data variable or return it? // problem }); } function doloop() { request() // execute ajax request data database var items = // returned json data function request() var count = items.length; var repeat = count * timeout; $(items).each(function(idx, text) { $("#text").queue(function(next) { $(this).html(text); next(); }).delay(timeout); }); } setinterval(function() { doloop(); }, repeat); the problem the problem can't ajax call return json data can put array. results in not being able count how many items there in array , calculate interval looping procedure. what wish accompl...

php - Parsing an img src with DOM returns only the first character of string -

Image
$doc = new domdocument(); $document=$doc->loadhtml($introtext); $imageparse = $doc->getelementsbytagname('img'); $i=0; foreach ($imageparse $parser) { $images[$i]= $parser->getattribute('src'); $i++; } var_dump($images[0]); introtext var: <p>ssdasadssdasadssd</p> <p>ssdasad</p> <p>ssdasad</p> <p>ssdasad</p> <p><img src="images/images.jpg" alt="" /></p> <p>ssdasad</p> <p>&nbsp;</p> <p>&nbsp;</p> var_dump($images[]) returns first character of string,instead of whole string. example: "images/images.jpg" = . if set src="gotrekt" , "g" output. funny thing yesterday in home used same code , worked,i copy pasted files usb today in work. also notice var_dump($introtext) give : this isnt legit right ? shouldnt shows html tags instead of getting executed? $introtext content of joomla articles m...

SignalA (SignalR Android Client) not working with SignalR 2.1.2 -

i tried use latest version of signala latest version of signalr 2.1.2, signala library throw exception of protocol verification. how can fix problem ? should if want contribute signala project , update last signalr version? there documentation should read? the signala client git repo doesn't seem have updated april 2014. suggest using signalr java client backed signalr official team. uptodate , working. can https://github.com/signalr/java-client

share - Sharing Android text with the icon of my app -

Image
is possible share text icon of app similiar this? because i've try works plain text , when try image share entire image, want little thumbnail. that's actual code: intent intent2=new intent(intent.action_send); intent2.settype("image/*"); intent2.putextra(intent.extra_text,random); uri path = uri.fromfile(new file(image)); intent2.putextra(intent.extra_stream, path ); startactivity(intent.createchooser(intent2, "share via")); try code: bitmap icon = mbitmap; intent share = new intent(intent.action_send); share.settype("image/jpeg"); bytearrayoutputstream bytes = new bytearrayoutputstream(); icon.compress(bitmap.compressformat.jpeg, 100, bytes); file f = new file(environment.getexternalstoragedirectory() + file.separator + "temporary_file.jpg"); try { f.createnewfile(); fileoutputstream fo = new fileoutputstream(f); fo.write(bytes.tobytearray())...

c# - Automatically set foreign key in grandchild table in Entity Framework 6 -

say have following objects public class myparent { public long id { get; set; } public string name { get; set; } } public class mychild { public long parentid; public virtual parent parent; public long id { get; set; } public string name { get; set; } } public class mygrandchild{ public long parentchildid; public virtual mychild parentchild; public long id { get; set; } public string name { get; set; } } now myparent top-level object, have child of mychild, , mychild has child of mygrandchild. in tables created, get myparent --id --name mychild -- parentid -- id -- name mygrandchild -- parentchildid -- id -- name now useful have foreign key myparent in mygrandchild table. i have tried changing mygrandchild object this public class mygrandchild{ public long parentid; public virtual myparent parent; public long parentchildid; public virtual mychild parentchild; public long id { get; set; } public string...

java - How to link static library in jni? -

i have created header file "abc.h" declaration int abc(); then, created .cpp file "abc.cpp" definition int abc() { return 0; } now created static library libabc.a above files. i have created helloworld android project. created jni folder in subfolders "header" , "src" in it. in header folder have put abc.h , in src folder have put "abc.cpp". have created file "xyz.cpp" in jni folder wants use abc() function. when run ndk-build command error. jni/jnimagiccleanmanager.cpp:84: error: undefined reference function abc (something this) how definition of abc() static library libabc.a have put libabc.a in same folder parallel android.mk. following android.mk file local_path := $(call my-dir) include $(clear_vars) magic_clean_root := .. magic_clean_src_root := ../$(local_path)/src magic_clean_src_files := xyz.cpp magic_clean_c_includes := $(local_path)/headers/ local_static_libraries := magicclean local_module := ...

node.js - Mongoose: How to populate 2 level deep population without populating fields of first level? in mongodb -

here mongoose schema: var schemaa = new schema({ field1: string, ....... fieldb : { type: schema.types.objectid, ref: 'schemab' } }); var schemab = new schema({ field1: string, ....... fieldc : { type: schema.types.objectid, ref: 'schemac' } }); var schemac = new schema({ field1: string, ....... ....... ....... }); while access schemaa using find query, want have fields/property of schemaa along schemab , schemac in same way apply join operation in sql database. this approach: schemaa.find({}) .populate('fieldb') .exec(function (err, result){ schemab.populate(result.fieldc,{path:'fieldb'},function(err, result){ ............................. }); }); the above code working perfectly, problem is: i want have information/properties/fields of schemac through schemaa, , don't want populate fields/properties of schemab. the reason not wanting properties of schemab is, population slows query u...

Java generics - compiler error -

what's wrong method definition? public static list<t extends myobject> t find() { } compiler says: syntax error, insert ";" complete methoddeclaration you have 2 return types there. if wanted introduce generic type t be public static <t extends myobject> list<t> find() {}

reporting services - How to handling "Error HRESULT E_FAIL has been returned from a call to a COM component" -

i use reporting services software , when export report pdf (or tiff) , error occurs: "error hresult e_fail has been returned call com component" http://upload7.ir/imgs/2014-11/81277343609975485437.png i sure of accuracy of report design , work on server correctly. in graphical reports , charts see " generic error occurred in gdi+ " instead chart! http://upload7.ir/imgs/2014-11/81277343609975485437.png i searched problem in several forums,someone recommended updating windows,reinstalling driver of graphical hardware , advice installing kb2495074 , it,.. try ,but can't handle error . see error on windows server 2008r2 , windows server 2012 , ms sql server 2008r2 , ms sql server 2012 . try using stimulreport alternative of reporting service, when export report pdf , error occurs: "pdffonts error @ point 5, code #80004005: operation completed successfully" export of pdf of report work in machine correctly! same address/9556304610854021566...

java - Combine plain SQL and DSL in SQL query in jOOQ -

i have complex plain sql query (with subselects, multiple joins, database specific functions) use jooq's dsl generating e.g. order clause. what achieve is: dsl .using(datasource) .select("select column table") .orderby(dsl.fieldbyname("column")) which jooq transforming to: select * (select column table) q order q.column; can done? you're close. following possible: dsl.using(datasource, dialect) .select() .from("(select column table) t") .orderby(dsl.field("t.column")); you have wrap (and depending on sql dialect, rename) derived table explicitly yourself. note i'm using dsl.field() , not dsl.fieldbyname() , latter produces case-sensitive column reference. plain sql query have produce case-sensitive column reference.

java - NoClassDefFoundError in nested jar (Android) -

i have created simple app test scenario failing noclassdeffounderror . lets take example have test1 android project class testclass methods. test1 project exported test1.jar , exported source folder class testclass , classpath , . project files. in android project test2 added test1.jar in libs folder. , in test2 project have class test2class calls methods of test1.jar class. after exported test2 project test2.jar file following above steps. so when use test2.jar in project above error noclassdeffounderror . scenario of jar inside jar. is anywhere should able access jar inside jar. thanks in advance. try step step: 1. remove library projects clean. 2. go first project test1 right click properties -> android. check is library (make library). 3. go second project test2 right click properties -> android in library section select add -> add first project library. 4. go second project test2 right click properties -> android. also, check is l...

ssl - Perl LWP::UserAgent cannot connect to HTTPS -

i have script used content google. work well, doesn't. found post on stackexchange , upgrade library version, still doesn't work: i cannot connect https site using lwp::useragent i have connectivity linux machine (telnet googleapis.com 443 works well). #!/usr/bin/perl use cgi 'param'; use cgi::carp 'fatalstobrowser'; use dbi; require lwp::useragent; use lwp::protocol::https; use uri::escape; $env{perl_lwp_ssl_verify_hostname} = 0; $access_token='xxx'; print "lwp::useragent: ".lwp::useragent->version,"\n"; print "lwp::protocol::https: ".lwp::protocol::https->version,"\n"; $url="https://www.googleapis.com/oauth2/v1/userinfo?access_token=$access_token"; $ua = lwp::useragent->new(ssl_opts => { verify_hostname => 0 }); $ua->agent('mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/35.0.1916.153 safari/537.36')...

Marklogic querying on HDFS -

is possible search , query data on hdfs marklogic server without importing data marklogic server database?? have been able import data marklogic server database.but not able find details on how query data without importing.if there ways please on how so???? i'm not sure mean "query". query data in meaningful way, data needs in database. hdfs not database. if want keep forests on hdfs, can that: see marklogic hdfs docs . if want treat hdfs local filesystem, built-in functions xdmp:filesystem-directory , xdmp:filesystem-get seem accept hdfs:// urls. note you'll need configure marklogic hdfs client, described in marklogic hdfs docs . otherwise attempt access hdfs way throw svc-hdfsnot . alternatively if can set or build http rest-ish interface on hdfs, use xdmp:http-get , related functions.

php - HTML Button that saves and move to the next page -

i have small problem. want have button in html page saves every data added in textfields , when click move next page. my code follow... <input type=button onclick="location.href='education.php'" value='next'> but moves next page not save data in database ... can me please? thanks. try : <?php if(isset($_post['submit'])) { // insert query put here header('location: education.php'); } ?> <html> <head> </head> <body> <form action="<?php echo $_server['php_self']; ?>" method="post"> <input type="submit" value="next" name="submit"> </form> </body> </html> education.php : <?php echo "successfully updated."; ?>

java - Instance Synchronization -

i wrote small block of code understand concepts of synchronized blocks: public class objectlevelsynchronized { public void run() { synchronized(this) { try { system.out.println(thread.currentthread().getname()); thread.sleep(100); system.out.println(thread.currentthread().getname() + " finished."); }catch(exception e) { } } } public static void main(string[] args) throws exception { final objectlevelsynchronized c = new objectlevelsynchronized(); final objectlevelsynchronized c1 = new objectlevelsynchronized(); thread t = new thread(new runnable() { public void run() { c.run(); c.run(); } }, "mythread1"); thread t1 = new thread(new runnable() { public void run() { c1.run(); c1.run(); } ...

c++ - Boost.Asio IPv6 Why bind error? -

i want use ipv6 using boost asio in linux (fedora). nic is ifconfig -a em1: flags=4163<up,broadcast,running,multicast> mtu 1500 inet 172.16.16.109 netmask 255.255.255.0 broadcast 172.16.16.255 inet6 fe80::215:17ff:fe62:d168 prefixlen 64 scopeid 0x20<link> ether 00:15:17:62:d1:68 txqueuelen 1000 (ethernet) rx packets 59516986 bytes 7105720351 (6.6 gib) rx errors 0 dropped 5015310 overruns 0 frame 0 tx packets 8680244 bytes 1666346667 (1.5 gib) tx errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18 memory 0xb8820000-b8840000 and ipv6 udp bind code is... int main(int argc, char* argv[]) { try { boost::asio::io_service io_service; const char* ip_address_string = "fe80::215:17ff:fe62:d168"; // const char* ip_address_string = "::1"; // it's ok boost::asio::ip::address my_address = boost::asio::ip::addres...

mysql - Not getting leading zero while retrieving from table -

my table containing values in branch code column 0782,kums,0763,khu when select not getting leading zero's output 782,kums,763,khu , need leading 0 also.. mysql query given below select * candidate_details branch_code = '".$branch_code."'" please me thanks set property "zerofill" column. alter table candidate_details modify branch_code int(5) zerofill; hope helps.

android - Application with scheduled notifications -

i want create android application sends notifications time time, (eg every 6 hours), , user can interact notification snooze 5 minutes or reschedule following. concretely want know kind of libraries or tools i'll need use, start searching information , learning it. alarmmanager best suited activating notification in timed interval solution , afraid solution developer.android.com/reference/android/app/alarmmanager.html and notification developer.android.com/guide/topics/ui/notifiers/notifications.html how build notification developer.android.com/training/notify-user/build-notification.html you can reschedule the same alarm set on accordance user interaction

animation - jQuery Animate not working on mouse move -

i'm working on animated image gallery can see in fiddle here jquery, has few features: hover on category reveal images in category click image change load in full size display when mouse on right hand or left had side of screen, list of images displaying scrolls left or right accordingly. steps 1 , 2 work fine, item number 3 animations not working, first time working animations in jquery , have been pulling hair out.... can see goin wrong? this code detecting mouse position (works fine) , animating accordingly (doesn't work) $(document).mousemove(function(e) { var mx = e.pagex; var width = $(window).width(); var buffer = parseint(width) / 3; var rightbuf = width - buffer; var leftbuf = rightbuf - buffer; if(mx > rightbuf){ $('.menu-sub').animate({ "left": "-50px" }, "slow" ); }else if(mx < leftbuf){ $('.menu-sub').animate({ "left": "50px" },...

c - Issue Observed while using GDB -

i trying debug application use 1 static builded library. i want set break points in library tried set using below command : break ts.cpp:600(file name:line no) but says no source file named ts.cpp. make breakpoint pending on future shared library load?(y or [n]) so presses y here (i came know after browsing internet) after pressing y gdb not stopping @ break point , completed executing program. why gdb not stopped @ break point?? any input highly appreciated. no source file named ts.cpp this means 1 of 2 things: either file ts.cpp not compiled -g (or equivalently ts.o has been stripped), or the file ts.o not linked application. since seeing prints source, it's safe bet #1 actual root cause. info sources command shows application.c , not files of library that confirmation #1 root cause.

php - 'waiting time' for a drupal page taken is more thats why the drupal page is slow -

'waiting time' drupal page taken more thats why drupal page slow there 1 page in drupal site, loads in 23sec , page of 1.8mb. upon checking why slow, seems 'waiting' time taken large 19 secs. checked 'net' firebug plugin. also checked disabling custom modules , checking queries execution time. thing note 'https://' page. can server problem? tried boost module doesn't cache https:// pages. thanks! first thing switch sites theme standard drupal theme, break bits of site momentarily give indication if issue in site current theme. use console in chrome see hints. @ network tab , compare regular pages. js function timing out or taking forever. finally if think it's server install program called htop. monitor servers performance. try setting site locally recreate error. are there on complex views on page? if so, try disabling these find culprit.

apache - Redirecting root / home page to custom page screws up all other redirects in .htaccess -

i’ve merged 2 websites one. i’ve set .htaccess redirects pages on deactivated site (hkgolf.co.uk) redirect equivalent on other site ( http://harriskalinka.com ). this have , in .htaccess on deactivated site: redirect 301 / http://harriskalinka.com/ redirect 301 /work/ http://harriskalinka.com/work/ redirect 301 /projects_tag/academy/ http://harriskalinka.com/work/ redirect 301 /projects_tag/asia/ http://harriskalinka.com/work/ what like’d have visitors got old website’s home page redirected page on new site telling why have been redirected , other redirects work normal. did this: redirect 301 / http://harriskalinka.com/home/hk-golf-redirect/ redirect 301 /work/ http://harriskalinka.com/work/ redirect 301 /projects_tag/academy/ http://harriskalinka.com/work/ redirect 301 /projects_tag/asia/ http://harriskalinka.com/work/ what happens if go old sites home page (hkgolf.co.uk/) redirected http://harriskalinka.com/home/hk-golf-redirect/ (what want) the problem is if got hkg...

AEM (CQ5.6.1) local maven deployment only works sometimes -

i've gotten weird effects lately, when deploy cq application via maven local aem server, would't update correctly. e.g. when changing in dialog of component, have delete /app/myapp folder in crx , deploy again changes appear. i'm having hard time reproducing effect. happens seemingly in random intervals. please check filter.xml file. descriptor should contain root paths application probably: /app/myapp , /etc/designs/myapp , maybe couple others. for more information please check vault documentation (section using filters). file used cq package manager install content. in previous cq versions there behaviour filters ignored. starting cq 5.6 if content path not match filter.xml regexps won't installed. not match issue kindly check if updating filter.xml file helps.

java - TomcatEmbeddedServletContainer - Authentication required dialog box -

i'm trying access spring boot appication running on embedded tomcat container on local machine using http://localhost:8080/projectname/ as access application dialouge box being displayed. for non-embedded tomcact container can modify tomcat-server.xml , add <tomcat-users> <role rolename="manager"/> <role rolename="admin"/> <role rolename="admin-gui"/> <role rolename="manager-gui"/> <user username="admin" password="admin" roles="admin,manager,"/> </tomcat-users> how on embedded tomcat container? use adduser()/addrole() methods .

c# - Workflow background thread - how to wait -

i have persistent workflow (runned workflowapplication class) , need unit test correctness of runnung workflow. i running workflow unit test , runs fine, except receive error message in output window: system.appdomainunloadedexception: attempted access unloaded appdomain. can happen if test(s) started thread did not stop it. make sure threads started test(s) stopped before completion. i want test results of workflow run after persisted , unloaded, use code this: autoresetevent waithandle = new autoresetevent(false); workflowapplication wfapp = new workflowapplication(workflowtypeinstance, inputs); wfapp.unloaded = delegate(workflowapplicationeventargs e) { waithandle.set(); }; // .... wfapp.run(); waithandle.waitone(); the problem is, workflow application background thread not terminate right after unload of workflow, test method does. causes error message in output window. any idea / approach / point how wait background thread termination?

java - JavaFX: TableView, ObservableList and updating TableColumn -

i have following problem, i'm trying make gui input numbers , show in linechart , tableview . numbers on xaxis , left column weeks , numbers on yaxis , right column balances. it's supposed update balance if input same week twice. works out fine tableview . adds doesn't update values. public class linechartsample extends application { static final borderpane root = new borderpane(); static final hbox tabcha = new hbox(); static final gridpane texlab = new gridpane(); static final label woche = new label("woche: "); static final textfield wochet = new textfield(); static final label kontostand = new label("kontostand: "); static final textfield kontostandt = new textfield(); static final button hinzaend = new button("hinzufügen / Ändern"); static final button loeschen = new button("löschen"); static final label text = new label(); static final tableview<xychart.data<number, numb...

express - How do I expose my initialized bookshelf object to my routes file? -

as first foray nodejs/express/bookshelf please gentle , verbose if possible regards comments/answers. i'm having hard time figuring out how use express bookshelf, specifically, exposing objects in various modules. bookshelf docs ideally initialization should happen once , initialized bookshelf instance should returned 'throughout library'. in app.js file create knex/bookshelf connection database, , define model mapping table want.. (app.js) var knex = require('knex')({ client: 'sqlite3', connection: { filename: '<path-to-my-db' } }); ... var questionroutes = require('./routes/questions'); var app = express(); var bookshelf = require('bookshelf')(knex); // define model var question = bookshelf.model.extend({ tablename: 'questions' }); ... app.use('/', routes); app.use('/api', questionroutes); in routing file want pull in data using bookshelf... (routes/quesions.js)...

css - jQuery UI Accordion Header: ui-helper-reset is not being added -

i have updated project's jquery 1.9.2 1.11.2 , seems working fine except accordion large cannot see content. prior code: $('.accordion').accordion({ autoheight: false, fillspace: true, collapsible: true, navigation: true }); as autoheight, fillspace , navigation deprecated have updated to... $('.accordion').accordion({ heightstyle: "fill", collapsible: true }); now have massive margins below each closed accordion tab , text huge. quick search of resulting code shows thing missing ui-helper-reset class on h3-element (i.e. .accordion has it, content divs have it, h3-elements not). if add class hand headers did before. ideas on how class added? update this internal issue. there old custom jqueryui css file (1.8.23) messing up. looked @ jquery ui accordions css generated , ui-helper-reset no longer being added header. works, if not have old custom css file in way. how .addclass()? $('.accordion...

linux - Conflicts with file from package filesystem-3.2 -

after repeated attempts , trying google issue i'm stuck , looking fellow stackers. following wiki tcadmin have run following commands wget http://www.tcadmin.com/installer/mono-2.11.4-i386.rpm yum -y install mono-2.11.4-i386.rpm --nogpgcheck /opt/mono-2.11.4/bin/mozroots --import --sync --quiet /opt/mono-2.11.4/bin/mono --aot -o=all /opt/mono-2.11.4/lib/mono/2.0/mscorlib.dll in /opt/mono-2.11.4/lib/mono/gac/*/*/*.dll; /opt/mono-2.11.4/bin/mono --aot -o=all $i; done when yum part fails , outputs error. file / install of mono-2.11.4-bi.x86_64 conflicts file package filesystem-3.2-18.el7.x86_64 most sites , places suggest using override or force command sounds stupid , cause issues down road myself , system. i have flagged ticket company supplies wiki issue i'm yet have reply. another suggestion extract rpm , move files 1 one quite time consuming.. the ticket responed following; it safe force install because files placed in /opt/mono-2.11.4 there bug mon...

My sublime doesnt recognize @import. What should i do to import another css through sass? -

i tried several times use @import 'reset' in sass code. unfortunately not importing. rest of code sublime highlights , recognise no problem. should @import reset.css through sass? when @import ing css files sass, need specify file extension (e.g. @import "reset.css"; ). see documentation. note: importing file .css extension result in real "css import" @ runtime instead of inline sass-like import. if want inject contents of file compiled css, change file extension .scss .

mysql - invalid : aggregate function or the GROUP BY clause -

hey guys can't seem figure out i'm doing wrong here. i'm quite new sql can't wrap head around this. great! select pc.name [productcategoryname] , min(pch.standardcost) minstandardcost , avg(pch.standardcost) averagestandardcost , max(pch.standardcost) maxstandardcost productcategory pc inner join product p on (pc.productcategoryid = p.productcategoryid) inner join productcosthistory pch on ( p.productid = pch.productid) pc.name '%bike%' you forgot group clause: select pc.name [productcategoryname] , min(pch.standardcost) minstandardcost , avg(pch.standardcost) averagestandardcost , max(pch.standardcost) maxstandardcost productcategory pc inner join product p on (pc.productcategoryid = p.productcategoryid) inner join productcosthistory pch on ( p.productid = pch.productid) pc.name '%bike%' group pc.name

ruby on rails - Difference between single and double equals in Slim (= vs ==) -

in slim, when should use double equals sign? for example: == yield == render 'partial' == stylesheet_link_tag "application", media: "all" title == full_title(yield(:title)) - flash.each |key, value| == value or = yield = render 'partial' = stylesheet_link_tag "application", media: "all" title == full_title(yield(:title)) - flash.each |key, value| = value = inserts html escaped characters. example: = javascript_include_tag("1", "2") == inserts html without escaping. needed when have rendered html , need insert layout directly. example: == render 'footer'

javascript - Testing Subject using TestScheduler in RxJs -

i using rxjs count how many packets arrive in particular time window. code looks this: var packetsubject = new rx.subject(); var packetsinwindow = []; function startmonitoring() { var subscription = packetsubject .windowwithtime(1000) .select(function(window) { window.toarray().subscribe(function(elements) { packetsinwindow.push(elements.length); }); }) .subscribe(); } function newpacket(packet) { packetsubject.onnext(packet); } how unit test code using rx testscheduler? not find suitable example testing subjects. have example : var x = 0, scheduler = new rx.testscheduler(); var subject = new rx.subject(); subject.throttle(100, scheduler).subscribe(function (value) { x = value; }); scheduler.schedulewithabsolute(0, function () { subject.onnext(1);//trigger first event value 1 }); scheduler.schedulewithabsolute(50, function () { expect(x...

python - Upgrade to django 1.7 - instance becomes unicode -

i moved django 1.2.5 1.7.0 (a long overdue upgrade) , expected alot of things broke. have been able fix alot of things having 1 major issue. i have pickled objects stored in database. in django 1.2.5, ran below commands , below results >>> app.foo.models import mymodel s >>> s.objects.get(id = 34567) <mymodel: foo (bar)> >>> x = s.objects.get(id = 34567) >>> x.myobject <foor.bar.my class instance @ 0x3855878> >>> y = x.myobject >>> type(y) <type 'instance'> however on django 1.7.0 below >>> app.foo.models import mymodel s >>> s.objects.get(id = 34567) <mymodel: foo (bar)> >>> x = s.objects.get(id = 34567) >>> x.myobject vhjlzufuc3dlcknob2ljzqpwmjyycihkcdi2mwpnndekuydxzwjzaxrljwpwmjy0cnnnndmkkgxwmjy1cnniyshpbm9llnn1cnzletiudhjlzxn1cnzleqpucmvlqw5zd2vyq2hvawnlcnaynjykkgrwmjy3cmc0mqptj0vwyxblcickcdi2oapzzzqzcihscdi2oqpzymeoaw5vzs5zdxj2zxkylnryzwvzdxj...

jquery - Create an Array of names of last 7 days starting from today - javascript -

i'm trying figure out, how create javascript array of names of ie. last 7 days starting today. i know getday() return number of day, can use index access element of array containing days of week. give me name of today, need go chronologically create array of last few days couldn't find similar problem on web. any elegant solution this? jquery perhaps? see jsfiddle: edit: store 7 days variable http://jsfiddle.net/vdesign/y7ggqzrf/1/ var days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saterday', 'sunday']; var gobackdays = 7; $(function() { var today = new date(); var dayssorted = []; for(var = 0; < gobackdays; i++) { var newdate = new date(today.setdate(today.getdate() - 1)); dayssorted.push(days[newdate.getday()]); } alert(dayssorted); }); //output: //[thursday, wednesday, tuesday, monday, sunday, saterday, friday]

android - ImageView scaleType, crop right and bottom sides -

how fill imageview bitmap maintain aspect ratio ? if i'm using scaletype="centercrop" crops top of image, want crop right , bottom sides. thanks. you read this: link adjustviewbounds @ android developer theres similar question here has been solved detailed explanation: link solved question

javascript - Hide other reciepient in to address while sending email using nodeemailer -

i working on emailsender project using node.js. found nodeemailer package making easier. but when sending email multiple contacts , contact seeing other contact addresses in column. i want hide others receiver. receiver see email address only. the code using is, var mailoptions = { from: 'sender@sender.com', // sender address to: 'reciever1@domain.com,reciever1@domain.com', // list of receivers subject: 'hello', // subject line text: 'hello world', // plaintext body html: '<b>hello world</b>' // html body }; transporter.sendmail(mailoptions, function(error, info) { if (error) { res.send(error); } else { res.send('message sent: ' + res); } }); the question when receiver1 gets email, should not know receiver2 got same email. thanks. store listofrecipients in array , loop through them var listofrecipients = [...