Posts

Showing posts from February, 2015

sql - combobox.column property returns invalid use of null in vba -

i database//access noob, bear me. have database set keep track of consultants , vendors tech consulting company. consultants own vendors, , have third-party vendors handle contracting. in case consultant own vendor, contact information same both. contact info stored in separate table, primary key contactid , foreign key fields consultantid (primary key in consultantt) , vendorid (primary key in vendort). in case relevant contact info has been entered on 1 of forms, want able select existing contact info record , tell database add other foreign key id field existing record based on record on main form. so, example, if have entered contact info consultant via consultant form, when open vendor form add consultant a's vendor want option select "consultant a" combo box , have info populate vendorsf's contact info form while adding vendorid existing contact info record consultant a. i think i've worked out, stuck on 1 last thing. right have popup form (choosecon...

python - How to combine different cells according to the customer ID? -

this question has answer here: transform dataframe grouping row 3 answers i have transaction data set , want transform according customer id. sample given below. customerid description 17850 white hanging heart t-light holder 17850 white metal lantern 13047 assorted colour bird ornament 13047 poppy's playhouse bedroom 13047 poppy's playhouse kitchen i want data set in following order:- 17850 white hanging heart t-light holder, white metal lantern 13047 assorted colour bird ornament,poppy's playhouse bedroom, poppy's playhouse kitchen the dataset in csv format , each value in separate cell. can suggest method in excel or r or python? you can use aggregate() function, created own data, can own data frame above. based on customer number, texts concatenated > df <- da...

Php required field -

i trying insert records dont know how check required fields , form controls.can show me how can check required fields? new in php. thank you. if(isset($_post['submitted']) == 1) { $ad = mysqli_real_escape_string($dbc, $_post['name']); $soyad = mysqli_real_escape_string($dbc, $_post['surname']); $email = mysqli_real_escape_string($dbc, $_post['email']); $q = "insert db (name, surname,email) values ('$name', '$surname', '$email')"; $r = mysqli_query($dbc, $q); if($r){ $message = '<p>message added!</p>'; } else { $message = '<p>could not add because: '.mysqli_errno($dbc); $message .= '<p>'.$q.'<p>'; } } your form , php code not aware of limitation set on database table. can ask database how table looks using describe keyword followed table name. ( http://dev.mysql.com/doc/refman/5.7...

Python Django Getting user input -

i setting simple html page, page captures information user entered , based on information user entered makes new page. problem cant information entered user @ backed , dont understand going wrong. my views file setup this: def suggestion(request): if request.method == 'post': form = businessname(request.post) if form.is_valid(): data=form.cleaned_data context = insert_function_here(data) return render( request,'mainpage.html', context) else: form = businessname() context = {'form':form} return render( request,'mainpage.html', context) my forms.py setup this: class businessname(forms.form): business_name = forms.charfield(widget = forms.hiddeninput(), required = false) the relevant part of html set this: <form id="user_input_form" method="post" action="http://127.0.0.1:8000/textinsighters/suggestion"> enter...

Custom list.sort comparisons in C++ -

i have std::list i'm trying sort based on calculations. point2d struct int no, double x, , double y; here's method contains list.sort code: std::vector<point2d> grahamscan::getsortedpointset(std::vector<point2d> points) { point2d lowest = getlowestpoint(points); std::list<point2d> list; (int = 0; < (int)points.size(); i++) { list.push_back(points[i]); } list.sort(compare_points); std::vector<point2d> temp; (int = 0; < (int)list.size(); i++) { temp.push_back(list.front()); list.pop_front(); } return temp; } and here's compare_points method wrote: bool grahamscan::compare_points(const point2d& a, const point2d& b) { if (a.x == b.x && a.y == b.y) { return false; } double thetaa = atan2((long)a.y - lowest.y, (long)a.x - lowest.x); double thetab = atan2((long)b.y - lowest.y, (long)b.x - lowest.x); if (thetaa < thetab) { return false; } else if (thetaa > thetab) { return true; } else { ...

javascript - Autocomplete: Why will my response object not return both first and last name ? -

i'm totally new jquery autocomplete using ajax. have got 90% way there code below. using chrome dev tools can see all values coming through next firstname:item.firstname1 , say, firstname,lastname, telephone etc. , if have 3 matches displayed sequentially. screw things up. lastname , telephone objects appear redundant , nothing appears next them. furthermore none of values appear options on screen. however, 3 empty options show 3 objects found. select:function(event, ui) not work either. have read docs 100 times not getting anywhere fast. i'd grateful if work, explain have done wrong. tks ! javascript: $('#customer').autocomplete({ minlength: 2, source: function(request, response,term) { var param = request.term; $.ajax({ url: "quotes/customer_search/"+param, datatype: "json", type:"get", success: function (data) { response($.map(data, ...

typescript - How to add "colSpan" attribute in ReactJS -

i'm getting error " type string not assignable type number " when try add colspan="2" attribute below reactjs typescript code. how can fix this? class productcategoryrow extends react.component<myprops, mystate> { constructor(props: myprops) { super(props); } render() { return (<div> <tr><th colspan="2">{ this.props.category }</th></tr> </div>); } //end render. } //end class. have tried <th colspan={2}>{ this.props.category}</th> ?

pyspark - Spark - Register model objects with Kyro - Caused by: java.lang.IllegalArgumentException: Class is not registered: -

i registering classes has business logic , model classes kyro in spark . below exception > job aborted due stage failure: task 14 in stage 1.0 failed 4 times, > recent failure: lost task 14.3 in stage 1.0 (tid 90, **): > java.lang.illegalargumentexception: class not registered: object[] > note: register class use: kryo.register(object[].class); @ > com.esotericsoftware.kryo.kryo.getregistration(kryo.java:442) @ > com.esotericsoftware.kryo.util.defaultclassresolver.writeclass(defaultclassresolver.java:79) > @ com.esotericsoftware.kryo.kryo.writeclass(kryo.java:472) @ > com.esotericsoftware.kryo.kryo.writeclassandobject(kryo.java:565) @ > org.apache.spark.serializer.kryoserializerinstance.serialize(kryoserializer.scala:296) > @ > org.apache.spark.executor.executor$taskrunner.run(executor.scala:239) > @ > java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) > @ > java.util.concurrent.threadp...

python - How to feed Cifar10 trained model with my own image and get label as output? -

i trying use trained model based on cifar10 tutorial , feed external image 32x32 (jpg or png). goal able the label output . in other words, want feed network single jpeg image of size 32 x 32, 3 channels no label input , have inference process give me tf.argmax(logits, 1) . able use trained cifar10 model on external image , see class spit out. i have been trying based on cifar10 tutorial , unfortunately have issues. session concept , batch concept. any doing cifar10 appreciated. here implemented code far compilation issues : #!/usr/bin/env python __future__ import absolute_import __future__ import division __future__ import print_function datetime import datetime import math import time import tensorflow.python.platform tensorflow.python.platform import gfile import numpy np import tensorflow tf import cifar10 import cifar10_input import os import faultnet_flags pil import image flags = tf.app.flags.flags def evaluate(): filename_queue = tf.train.string_input_p...

algorithm - Can an array be grouped more efficiently than sorted? -

while working on example code algorithm question, came across situation sorting input array, though needed have identical elements grouped together, not in particular order, e.g.: {1,2,4,1,4,3,2} → {1,1,2,2,4,4,3} or {1,1,2,2,3,4,4} or {3,1,1,2,2,4,4} or ... which made me wonder: is possible group identical elements in array more efficiently sorting array? on 1 hand, fact elements don't need moved particular location means more freedom find order requires fewer swaps. on other hand, keeping track of every element in group located, , optimal final location is, may need more calculations sorting array. a logical candidate type of counting sort , if array length and/or value range impractically large? for sake of argument, let's array large (e.g. million elements), contains 32-bit integers, , number of identical elements per value 1 million. update: languages support dictionaries, salvador dali's answer way go. i'd still interested in hearing ol...

jQuery toggle and how to change text -

i'm new jquery bare me. i'm using toggle feature toggle , forth between div container hidden. when clicking on 'show more' link displays div, , when clicking on 'show less' link hides div. here code: $('.transcript').addclass('hide') $(".show-more").click(function(){ $(".transcript").toggle(); $(".transcript").removeclass('hide'); $(".show-more").html('show less'); }); the problem having when click 'show more', displays hidden div , changes text of link 'show less'. however, text of link remains 'show less' when should go 'show more' when div hidden. thanks in advance! i think figured out, code seems work: $('.transcript').addclass('hide'); $('.show-more').on('click', function() { var $this = $(this); if($('.transcript').is(':visible')) { $('.transcript').hide(); $this.te...

c# - Logitech's LED Illumination SDK is not working with my G502 -

i'm trying logitech's own led sdk working g502, can't. i'm using sdk version 8.82.7, is, of now, recent version. couldn't find on or rest of internet, i'm asking here. here's logitechgsdk.cs: using system; using system.collections; using system.runtime.interopservices; namespace logirgb { public enum keyboardnames { esc = 0x01, f1 = 0x3b, f2 = 0x3c, f3 = 0x3d, f4 = 0x3e, f5 = 0x3f, f6 = 0x40, f7 = 0x41, f8 = 0x42, f9 = 0x43, f10 = 0x44, f11 = 0x57, f12 = 0x58, print_screen = 0x137, scroll_lock = 0x46, pause_break = 0x45, tilde = 0x29, 1 = 0x02, 2 = 0x03, 3 = 0x04, 4 = 0x05, 5 = 0x06, 6 = 0x07, 7 = 0x08, 8 = 0x09, 9 = 0x0a, 0 = 0x0b, minus = 0x0c, equals = 0x0d, backspace = 0x0e, insert = 0x152, ...

python - How can I extract City, Region, Country from URL? Django -

my search field returns this: http://localhost:8000/search/?city=new+york%2c+ny%2c+united+states how can extract city, region, country. i've been through document: https://docs.python.org/2/library/urlparse.html and question: how can extract city, region, country url? django but not sure how seperate them. python 2.7 >>> urlparse import urlparse, parse_qs >>> u = urlparse('http://localhost:8000/search/?city=new+york%2c+ny%2c+united+states') >>> q = parse_qs(u.query) >>> q['city'] ['new york, ny, united states'] >>> q['city'][0].split(', ') ['new york', 'ny', 'united states']

javascript - How to have an element fade out and another element fade in in its place on window load? -

i trying create splash screen website , have made progress bar make nicer. have links user login or register. what want achieve is, right after window loads, have progress bar thing 4 seconds have fade out in .5 seconds , have links fade in in place in .5s total of 5 seconds before user can proceed. i have put code make work using mainly: settimeout(); but despite having no errors far both , google chrome console can tell, no visible result produced. how can fix code work properly? suggestions appreciated. prefer solution in plain javascript, if there's no other way, satisfied jquery 1 too. to you, have assembled demo here . no doubt switch jquery. fadein , fadeout easily: $(window).load(function(){ var t=settimeout(function(){ $("#progressbar").fadeout(500); $("#splashscreen-links").fadein(500); },4000) }) @-webkit-keyframes greenglow { { left:-120px; } { left:100%; } } ...

javascript - Destination not defined error on grunt replace -

i trying use grunt replace change names of files , add random number file prevent caching of images, css , js files. so running following code module.exports = function replace(grunt) { var randomversion = ((new date()).valueof().tostring()) + (math.floor((math.random() * 1000000) + 1).tostring()); var replace = { options: { variables: { 'randomversion': randomversion }, overwrite: true }, files: [{ src: './target/dist/index.html', dest: './target/dist/index.' + randomversion + '.html' }] }; console.log(randomversion); grunt.config.set('replace', replace); }; but "destination not defined can shed light on this? thanks i not code trying achieve, proceed answer according understanding. first, trying use grunt-replace library? if so, think incorrect. library replacing values within contents of source f...

javascript - How to track the progress of a large OrderBy -

i have standard enough dynamically filled table in bootstrap instantiated following definition <table> <tr ng-repeat="c in controller.items : orderby:controller.predicate:controller.reverse">...</tr> </table> and pretty standard function that, when called string argument, sort table, using string argument predicate. controller.ordercasesby = function (predicate) { controller.reverse = (controller.predicate === predicate) ? !controller.reverse : false; controller.predicate = predicate; } the page i'm working on potentially has upwards thousand rows, trying figure out way track progress of ordering function , update progress bar accordingly. if case trying track progress of entire table rendering first time, attach ng-init function each repeated row update progress bar whenever it's called. ng-init functions don't seem called when table reordered, however, wondering if there achieve similar effect....

angularjs - Provide template with expressions as attribute on directive -

i'm wanting pass "template" directive, means of attribute. here's trite example of i'm trying accomplish: this html: <greeter person-name="jim" greeting-template="hello {{name}}"></greeter> would produce output: hello jim . i've tried directive this: function greeter($interpolate) { var directive = { link: link, restrict: 'ea', template: '<div>{{evaluatedtemplate}}</div>' }; return directive; function link(scope, element, attrs) { scope.name = attrs.personname; scope.evaluatedtemplate = $interpolate(attrs.greetingtemplate)(scope); } } but doesn't work, because {{name}} in greeting-template attribute gets evaluated in parent scope before gets far directive link function. ultimately, need value of attrs.greetingtemplate literally string of: 'hello {{name}}'. figure alternative syntax, having greeting-template ...

ruby on rails - How to submit a form and delete a post -

i have 2 models in rails project: link , campaign . in show.html.erb link have form create new campaign looks this <%= form_for :campaign, url: campaigns_path |f| %> <%= f.hidden_field :name, value: current_user.email %> <%= f.hidden_field :product, value: @link.product %> <%= f.hidden_field :title, value: @link.title %> <%= f.hidden_field :website, value: current_user.website %> <%= f.hidden_field :productlink, value: @link.url %> <%= f.hidden_field :description, value: @link.description %> <%= f.hidden_field :date, value: date.today.to_s %> <br> <br> <%= f.submit :"let's go make money", class: "btn btn-primary" %> <% end %> this works. problem deleting post link while creating new post based on campaign . basically, want submit form , delete else. you pass id of link want destroy in form_for: <%= form_for @campaign, :url => { :...

regex - Regular expression match if there's non-alphabetical character at the end, or nothing? -

i have regular expressions match homonyms, tw?oo? match either two , to , or too . (it matches twoo , that's ok). my question is, want regular expression match if there punctuation or other nonalphabetical character @ ends, to, or two. or ,too! . if there's nothing @ end, that's ok well. so want match tw?oo? if there no other characters on each side, or if there non-alphabetical characters, not if there letters around: tomorrow shouldn't match. i tried [^a-za-z]?tw?oo?[^a-za-z]? , since character classes optional ommitted. how this, regex matches words if on own, or surrounded punctutation. (spaces aren't problem, they've been cut out) thanks! use word boundaries \b . match whenever word character ( \w ) , non-word character adjacent: for (qw/two tomorrow/) { "$_ ", /\b(?:two|to|too)\b/ ? "matches" : "doesn't match"; } output: two matches matches tomorrow doesn't match edit i change...

java - Why cant send mail through smtp server? -

i try send mail hotmail yahoo/gmail using code below smtp.live.com or smtp-mail.outlook.com keep getting error : string = sendto.gettext(); string = username; java.security.security.addprovider(new com.sun.net.ssl.internal.ssl.provider()); properties properties = system.getproperties(); properties.put("mail.smtp.ssl.enable","true"); properties.put("mail.smtp.host", "smtp.live.com"); // try smtp-mail.outlook.com cant properties.put("mail.smtp.port", 465); properties.put("mail.smtp.auth", "true"); authenticator authenticator = new authenticator() { protected passwordauthentication getpasswordauthentication() { return new passwordauthentication(username,passwd); }}; session session = session.getinstance(properties,authenticator); //default session if(attachment.gettext().isempty()){ try{ ...

During which state I should save and Load one single data in an android app -

i creating simple application display quotes. want set counter gets passed api , api fetches quote. researched bit , found out can use sharedpreferences this. however question should save , load counter. confused. should load counter during oncreate method , save in onpause method? know can't save during ondestroy method because read ondestroy method doesn't called everytime. can me out? first time dealing android cycles in detail. thank you.

Drupal ecommerce theme no correctly viewed -

Image
im quite new drupal, @ moment ive been trying install commerce theme dont correct appearance of it the original theme how looks in localhost i have alreay installed drupal commerce, panels, ctoold, views etc... can sosmebody tell me has gone wrong , how original of theme there lot of things need after installing theme. after installing new theme should following: change default logo site logo. check menu items displayed , manage them in structure>>menus add slider images checking add images (read theme readme.txt) add content display in appropriate areas. add products site. configure home page link. configure categories / popular categories tags blocks. configure special offers block. may need create view block display. place search block in appropriate region. i listing few , can figure out rest if not @ position. note: theme provides basic regions, templates, css , icons structure, , have manage site content , feel.

java - How do I get user input when I run my jar file from command prompt? -

in netbeans, program works perfectly. gets user input using scanner. however, when run jar file in command prompt, skips user input , runs program anyways. why , how correct this? example: public static void main(string[] args) { system.out.print("how many teachers need assignment (two classes assigned each teacher)? "); numteachers = input.next(); } it never prints out first line either because first line never prints think find issue caused how run program, because if works in netbeans that's difference. first open console window in folder program run jar file normal: java -jar myapplication.jar if double click jar file run instantly, , because there no console close instantly. java programs use console must run console/command prompt/terminal. edit: in case, worth double checking how setup scanner. should example: https://stackoverflow.com/a/17691245/1270000 public static void main(string args[]){ scanner scanne...

jquery - How to set selected option to default selected in Javascript -

i have select option materialize style, in select option want check value of option exist in database or not. html code : <div class="row margin"> <div id="input-select" class="section"> <label>supir</label> <select name="id_personalia" id="id_personalia" onchange="cek_supir()"> <option id="default_supir" value="default_supir" disabled selected>pilih supir</option> <?php foreach ($supir $s) { ?> <option value="<?= $s->id_personalia; ?>"> <?= $s->nama_ktp . " " . $s->id_personalia; ?> </option> <?php } ?> </select> </div> </div> javascript code : <script> function cek_supir() { var supir = document.getele...

How to get id of any page in codeigniter controller -

i new in codeigniter. how id of below page in codeigniter controller. www.abc.com/about-us - page www.abc.com/blog/hello-world - blog details page www.abc.com/city - categories www.abc.com/search - pass input field please me. code model this <?php defined('basepath') or exit('no direct script access allowed'); class blog_model extends my_model { public function __construct(){ parent::__construct(); } } ?> and controller like <?php defined('basepath') or exit('no direct script access allowed'); class blog extends my_controller { protected $per_page=1; public function __construct(){ parent::__construct(); $this->load->model('blog_model'); } public function index($page=1){ $page = $page-1; if($page<0){ $page =0; } $where = ' status = ?'; $where_data = array(1); $rs = $this->blog_...

javascript - three.js - What's the best way to put multiple textures/images on a single Sphere? -

as in title, i'm trying this: http://taggalaxy.de/ i've images, i'm trying undestand how put them on single sphere. thanks! first, need change default uv coordinates used in sphere corners of each square region uv coordinates (0,0), (1,0), (0,1), , (1,1). then, when creating mesh, material use meshfacematerial, should contain array of materials want use on sphere. finally, each of faces in geometry of mesh, need set materialindex field corresponding index of material in array. related question, should check out: three.js - multiple material plane edit: sample code below var v00 = new three.vector2(0,0); var v01 = new three.vector2(0,1); var v10 = new three.vector2(1,0); var v11 = new three.vector2(1,1); var m1 = new three.meshbasicmaterial( {map: new three.imageutils.loadtexture('images/background.jpg') } ); var m2 = new three.meshbasicmaterial( { map: new three.imageutils.loadtexture('images/special-square.png') } ); var m = new thr...

angularjs - Angular history implementation without unique URLS -

i have been looking around history implementation in angular handles , forward buttons have found nothing consider documented , simple use. options seem require changing url avoid unless impossible reason. i wondering if there exists angular project or built-in functionality provide history , button. looking assistance here because google providing little seems relevant , unclear terms might search find need. thanks, jason

app store - you have no eligible Bundle IDs for iOS apps -

i have added 1 account apple id.so,now have 2 accounts linked 1 apple id. able add apps through previous account.but now,i trying register app through added account, shows me you have no eligible bundle ids ios apps error if have valid bundle id , provisional profile. stuck issue , not able resolve. appreciated resolve issue @ earliest possible. on general screen project can select team. have correct team selected? also, have created bundle id on apple developer site using new account?

Unable to get work info at Facebook Login android -

Image
i have integrated facebook login in app. want education , work history of user. have got permission facebook, not getting data in response. below screenshots of permissions: below code login: facebooklogin.setreadpermissions(arrays.aslist("email","user_work_history")); facebooklogin.registercallback(callbackmanager, new facebookcallback<loginresult>() { @override public void onsuccess(loginresult loginresult) { graphrequest request = graphrequest.newmerequest(loginresult.getaccesstoken(), new graphrequest.graphjsonobjectcallback() { @override public void oncompleted(jsonobject object, graphresponse response) { log.i("loginactivity", response.tostring()); // facebook data login bundle bfacebookdata = getfacebookdata(object); } }); bundle parameters = new bundle(); ...

objective c - Custom iOS framework for use with Swift project. Mach-O Type Dynamic and Static, both causing different issues -

i'm using xcode 7.1, ios sdk 9.1. i have created cocoa touch framework (myfw) in objective-c uses 3rd party framework (fw-a). have added fw-a myfw linked framework/library since it's dependency. in sample app, have added myfw , podfile fw-a dependency. case 1: myfw has mach-o type = 'dynamic library':- at runtime, there warnings classes of fw-a "class xyz implemented in both "myfw" , "sample app". 1 of 2 used. 1 undefined. checked many posts issue couldn't find viable solution. case 2: myfw has mach-o type = 'static library' :- the app not throw warnings or errors @ compile-time or run-time. when create ipa file of sample app , try install on device using itunes; fails install every time. question: which issue in case easier resolve? as umbrella frameworks highly discouraged apple, i'm not taking approach.

Azure Virtual Machine Billing -

i dont know if right place, assuming msft staff answers these questions since azure portal links stackoverflow? questions: i understand azure no longer bills me vm long , cloud service stopped. unclear going billed cloud service itself? example create virtual machine , doing cloud service (with ip). turn off virtual machine , cloud service. still billed cloud service though turned off? continuing on question above. billed storage fees virtual machines filesystem. windows vms around 120gb in size. how billing work out virtual machines? , how change if machine turned off. how custom images billed? create windows 2012 master image iis , few other components installed. create own image can bring vms more rapidly. vm image stored? in blob container under vhd's? , again microsoft charge me store image? full 120+ gb or actual size of image stored. sorry ask these questions. tried best google around , find post scott gu stated vms wont billed , little detail b...

admob - Showing Native Ads inside WebView content in Android? -

i want know how show native ad inside webview content @ random position everytime. suppose loading static html page in webview. possible show native inside webview html page @ random position when user reading content of page native ads appear inside content.

Project management - replacement to JIRA which wouldn't support SVN -

we working jira , svn , great. love way jira works , think. unfortunately jira stop supporting svn on oct 2013 . want continue svn. i need tool supports followings: task blocking (i should able mark task blocking other tasks , being blocked others) svn integration plugin - easy in jira which 1 should use? looking hosted solution i read comparison table in wikipedia, experience better in case of pure local solution (your svn-server, projecttracker) mantis (mostly bugtracker, roadmap|changelog, related tickets, custom fields can be considered type of alm-tool) + source-integration plugin mantis hosted solution assembla internal subversion tool or external subversion tool + tickets custom fields (and "blocking tickets"+"blocked tickets" in tickets reports, automagically appeared)

ios - Getting error in displaying text through textview -

i have created application in have added text through uitextview programmatically , add textview subview of custom viewcontroller. problem text not displaying in viewcontroller. please me through this. code this-- uitextview *textview =[[uitextview alloc] init]; textview.text = @"text here"; [textview setfont:[uifont systemfontofsize:90]]; textview.delegate = self; [textview setbackgroundcolor: [uicolor clearcolor]]; [textview settextcolor: [uicolor whitecolor]]; textview.frame=cgrectmake(150,300,self.view.frame.size.width-40,200); //textview.transform = cgaffinetransformmakerotation(m_pi_4); [textview setreturnkeytype:uireturnkeydone]; textview.autoresizingmask = uiviewautoresizingflexiblewidth; [self.view addsubview:textview]; sometimes ibuilder missed custommodule="appname" custommoduleprovider="target" to fix it, open storyboard source code , replace line: <viewcontroller storyboardidentifier="storyboardid" id="so...

What is the relation between the dog and animal classes in this Python code? -

class animal(object): pass class dog(animal): def __init__(self): print "i got called" i found code in book "learn python hard way". have questions relationship between dog , animal ? are dog , animal both classes , dog inherit animal ? the class dog inherited class animal . means object of class dog gets attributes , methods animal class defines. class dog called subclass or inherited class while class animal called superclass or parent class. usually subclass used extend functionality of class. class dog can modify attributes and/or functionalities of animal and/or add own.

Xtrareport Devexpress bind data from dataset -

Image
i have problem xtrareport. trying binding data report datatable. result blank. i have documentviewer in design code try bind data datatable dt = bdmvanbanden.selectall(); var report = new rptvanbanden(); report.datasource = dt; documentviewerreport.report = report; documentviewerreport.databind(); this report and result : so, that's why? in rapport must define binding of xrtablecell : public partial class rptvanbanden: devexpress.xtrareports.ui.xtrareport { public rptvanbanden(datatable dt) { initializecomponent(); //*********you must repeat block each `xrtablecell` xrbinding binding = new xrbinding(); binding = new xrbinding("text", dt,dt.columns["ngayden"].columnname); ngayden.databindings.add(binding); //"ngayden" here isname of xrtablecell //*********************** } } now...

c - Is a type cast necessary while converting between signed int and unsigned int? -

i tried assigning signed int unsigned int. #include <stdio.h> int main() { int a; unsigned int b; scanf("%d", &a); b = a; printf("%d %u\n", a, b); return 0; } i hoping compiling cause warning assigning int value unsigned int variable. did not warning. $ gcc -std=c99 -wall -wextra -pedantic foo.c $ echo -1 | ./a.out -1 4294967295 next tried assigning unsigned int signed int. #include <stdio.h> int main() { int a; unsigned int b; scanf("%u", &b); = b; printf("%d %u\n", a, b); return 0; } still no warning. $ gcc -std=c99 -wall -wextra -pedantic bar.c $ echo 4294967295 | ./a.out -1 4294967295 two questions: why no warnings generated in these cases though input gets modified during conversions? is type cast necessary in either of cases? code 1: conversion well-defined. if int out of range of unsigned int , uint_max + 1 added bring in range. since code correct , normal,...

javascript - AngularJS filter and summary -

i have object : $scope.basketlist = [{id : a1, name : metal}, {id : a2, name : plastic}, {id : b1, name : fiber}]; $scope.itemlist = [{ id : 1, basket_id : 'a1', ctg : 'fruit', stok : 3}, { id : 2, basket_id : 'a2', ctg : 'fruit', stock : 2}, { id : 4, basket_id : 'a1', ctg : 'fruit', stock : 4}, { id : 5, basket_id : 'b1', ctg : 'fruit', stock : 1}, { id : 6, basket_id : 'b1', ctg : 'fruit', stock : 2}, { id : 7, basket_id : 'a1', ctg : 'fruit', stock : 4}, { id : 8, basket_id : 'a2', ctg : 'fruit', stock : 2}]; in html : <div class="stock"> <div ng-repeat="basket in $scope.basketlist> <div>basket : {{basket.name}}</div> <div ng-repeat="item in itemlist | filter : {basket_id : basket.id}"></div> </div> </div> how filter , sum stock. so, output : metal friut, stock = 11 plastic ...

Data page in sql server -

is possible modify data pages in sql server in both perspective of data , size? there no way modify data pages in sql server. work data page can use dbcc . good articles explanation of how works: http://www.practicalsqldba.com/2012/08/sql-server-understanding-data-page.html http://www.sqlskills.com/blogs/paul/inside-the-storage-engine-using-dbcc-page-and-dbcc-ind-to-find-out-if-page-splits-ever-roll-back/

c++ - OpenCV won't open some videos of many videos of the same format -

Image
i using visual studio 2012 opencv 2.4.6. i have 4 videos recorded 1 one nokia lumia 920. opencv won't open .mp4 format phone default. converted these 4 videos using sony vegas .mp4 same preferences of them. problem opencv has problem open 2 of them. other 2 works charm no problem. below information codec used (yes, same videos): and error: why same type few of them loaded properly? i understand crash? if so, answer pretty simple: there's bug in codec, name of dll think that's ffmpeg h264 codec. should try update it, or avoid it.

java - Morphia vs Spring Data Mongo -

i using java language.i have use orm framework mongodb database.i have 2 options morphia or spring data mongo support.as far able details , has been found spring data mongo better use since: 1)it provides better dao out of box inbuilt classes. 2)it has larger community base. are there performance based differences between two.and if there 1 better in condition.also have requirement of multitenancy .after little search found there simple custom implementation in spring data mongo same.but in morphia difficult.does achieving multitenancy in morphia diificult(where need write lot of boiler plate code) morphia way go. pretty stable, play integration , offers access mongo driver features if need more torque. reference resolution, entity embedding working expected. lifecycle annotations too, pretty useful boilerplate persistence code. i spring-data because of hades project... don't need implement daos. write interface , spring data automatically provides you. spring dat...

c - vector allocation error subscript to pointer to incomplete type -

i have product typedef struct proditem *proditem; and have symbol table of products typedef struct tabp *tabp; struct tabp { proditem vettp; int np; }; i need allocate in memory, : tab->np = max; // quantity of products tab->vettp = malloc(max * sizeof(*proditem)); but if try use vector tab->vettp have error: tab->vettp[i] <<-- subscript pointer incomplete type can me? i solved myself, missing pointer * typedef struct tabp *tabp; struct tabp { proditem *vettp; int np; }; product item.h: #ifndef proditem_h #define proditem_h #include <stdio.h> #include <stdlib.h> typedef struct proditem *proditem; typedef char* prodkey ; proditem proditemscan(file*); void proditemshow(file*, proditem); int proditemcheckvoid(proditem); void proditemfree(proditem); int proditemgreater(proditem,proditem); prodkey prodkeyget(proditem); int prodkeycomp(prodkey, prodkey); #endif /* proditem_h */ symbol table.h #ifndef ta...

azure - IoT Hub - modify complex token creation (via MQTT) -

as per heading doing this, let me explain why. history : have done full host , client , working 100% on via .net. big our clients in field running on microcontroller (not microprocessor) has poor encryption libraries (embedded c, in particular pic). our firmware engineer guy battling hmac part of sas token generation work. other pieces of hub possible (mqtt, tls, url encoding, epoch etc) hmac sha256 struggle. i aware of protocol gateway offered can replace gateway’s authentication provider. have sample code/guide can follow. dev guide offered microsoft seems limited or maybe im being silly , missing plot. thanks help! light bulb moment ;) going keep our tcp channel open , unit auth on channel. ack key (will encrypt in simpler way ;))

angularjs - Unable to play sound through Phonegap Android Build -

i having app build cordova , angular js. trying play sound when new event occurs , trying achieve creating append of tag within new event function , calling #mysound.play(). when test on desktop browser there working on every new event can hear sound playing on other hand when create it's apk through phonegap , test on samsung galaxy there isn't playing sound on new event. kindly let me know if missing or better way achieve goal? function displayevents(data,div_id) { var icon_trans_type=''; var icons=''; var icons2=''; var htm=''; $.each( data, function( key, val ) { var new_tag=''; if (val.viewed==1){ $('<audio id="chataudio"><source src="locales/android/raw/notify.mp3" type="audio/mp3"></audio>').appendto('body'); $('#chataudio')[0].play(); new_tag='<div class=...

python - Object is not defined -

i have problem code. program designed parse file, select information , save them in list of objects of class. but first - not save them correctly. in fact, nothing save, returns empty records. i tried create minimum of code entirely , work on it. next not work. can not display objects not know if correctly saves them in class. changed xml smaller , sample see if search mistake. i think on long time, i'm running out of ideas, ask clue. minimum code from xml.dom import minidom class prot(): def __init__(self, name=''): self.name = name def addname(self, name): k in range(len(entry_list)): names = entry_list[k].getelementsbytagname("names") u in range(len(names)): nam = names[u].getelementsbytagname("name") name.append(nam[u].firstchild.nodevalue) print(nam[u].firstchild.nodevalue) xml = minidom.parse('residues.xml') entry_list = xml.ge...