Posts

Showing posts from January, 2012

salesforce - Is It possible to use Lightning app exchange components in custom lightning app? -

i installed lightning component app exchange ,now want use component in custom lightning app is possible?? <aura:app> //code adding components </aura:app> if working components: <aura:component > <aura:handler name="init" value="{!this}" action="{!c.doinit}"/> {!v.body} </aura:component> and in controller ("mvc:calendarcomponent" example, put here component): doinit : function(component, event, helper) { $a.createcomponent( "mvc:calendarcomponent", { }, function(newcmp){ if (component.isvalid()) { component.set("v.body", newcmp); } } ); }

smartface.io - Smartface 4.5 ios app startup message with individual license -

i have purchased individual license still appears ios app startup message "developer information" "this application created smartface community edition......" there no problem android. how eliminate ios app also? problem due using existing licenses community. have created new app license , problem solved!

debugging - GDB find command error "warning: Unable to access x bytes of target memory at y, halting search" -

i'm trying find current flag count in kmines using gdb. know should memory mappings first avoid non-existent memory locations. ran info proc mappings command see memory segments. picked random memory gap ( 0xd27000-0x168b000 ) result , executed find command this: find 0x00d27000, 0x0168b000, 10 but got warning: unable access 1458 bytes of target memory @ 0x168aa4f, halting search. error. although address 0x168aa4f between 0xd27000 , 0x168b000, gdb says can't access it. why happen? can avoid situation? or there way ignore unmapped/unaccessible memory locations? edit: tried set value of address 0x168aa4f 1 , works, gdb can access address gives error when used find command. why? i guess have solved own problem, can't believe how simple solution was. thing did decrease 2nd parameter's value one. code should find 0x00d27000, 0x0168afff, 10 because linux allocates memory using maps in [x,y) format, if line in root/proc/pid/maps says this; 01a03000-0222a...

Android Custom TabLayout: Icon overlays content -

Image
i'm looking custom tablayout . icon of tab in middle needs margin overlay content. please check out image below. what i've tried far tab.setcustomview() margin. doesn't overlay content though. looked tablayout libraries give such flexibility. didn't find fits need. re-invent wheel? since don't need complicated scrolling functionality, develop own tablayout couple viewgroups , textview , imageview . before have that: do know of library that? how approach it? any appreciated!

VBA, Excel, use Range to fill 2D-Array -

Image
this question has answer here: why having issues assigning range array of variants 3 answers i not understand behaviour: sub tues() dim a() variant = range("a1:a10") ' works dim b() variant b = activesheet.range("a1:a10") ' type mismatch end sub the first version works 2nd version not. why? difference? the way go adding ".value" @ end of range. idea make things explicit (the reason can omit because value default property range object) i added values watches see going on , apparently there problem of excel not been able ( , implicitly ) cast object on fly. note in picture how expression failing "activesheet.range("a1:a10") of type: variant/object/range; transition variant object causing issue. a way force cast correctly split process in 2 parts first 1 casts range , second 1 casts...

sql server - Read XML Schema and Data in .NET -

i'm using sql server , vb.net. in sql i'm using following: select top 1 * tablename 1=0 xml auto, type, xmlschema to schema tablename. use select * tablename id=1 xml, auto, type, elements xsinil, root('xml') to data row i'm interested. if use following code in vb: private ds new dataset ds.readxmlschema("xmlschema.txt") i end ds containing 1 table correctly defined set of columns if try: ds.readxml("xmldata.txt") the code succeeds, don't have rows in table of dataset. my question is, need in order read xml data created sql server datatable schema specified sql server. you need include xmlschema clause in second (data) query first (schema) query. if don't data output missing namespace , won't conform schema. you need specify target namespace schema qualifying xmlschema directive (e.g. xmlschema('http://tempuri.org') ). if don't sql server generate namespace in each query, , may not m...

Importing an Excel spreadsheet into SQL Server - trouble with data types -

i have imported excel spreadsheet sql server 2014 database , 1 of data types miscalculated. in excel, field date, sql server changed nvarchar. it's odd because there other dates in spreadsheet converted semi-correctly ("date" in excel converted "datetime" in sql). know turning off "prevent saving changes..." check mark doesn't help. plus learned through looking @ questions here on stackoverflow not recommended, don't want it. did try it, though, , still didn't change data type. reason, when try force change data type "nvarchar" "datetime", sql won't it. does have ideas why sql change data type , not let me change back? also, why sql change "date" data type excel "datetime" , not leave "date"? in advance responses.

nfc - Is it possible to emulate a felica card with an Android device? -

according android documentation : android (4.4 , above) supports emulating cards based on nfc-forum iso-dep specification (based on iso/iec 14443-4) , process application protocol data units (apdus) defined in iso/iec 7816-4 specification on other hand, falica cards compliant jis: x6319-4 per felica's wiki entry . so, presumably not possible use android device emulation of felica cards. accurate? that correct. but, there patches sony on aosp under review allow card emulation of felica cards. see example https://android-review.googlesource.com/#/c/128491/

How do you use Calligraphy with TabLayout in Android Design Support Library for custom Font in xml? -

how use calligraphy apply custom font tablayout design support library please? i have gotten work in java of answers seem refer to. (e.g. change font of tab text in android design support tablayout ) i'd prefer not make custom class, i'd use calligraphy. ( https://github.com/chrisjenx/calligraphy ) if use custom style tabtextappearance can change textsize fontpath doesn't have effect. thanks there way use custom font in xml tablayout, it's little bit hacky. have provide own custom layout tabs , in layout can style textviews whatever like. so need have setup: public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // viewpager , set it's pageradapter can display items viewpager viewpager = (viewpager) findviewbyid(r.id.viewpager); samplefragmentpageradapter pageradapter = ...

Arabic Word Net synonyms in Python? -

i using python 2.7, trying synonyms of arabic words using arabic wordnet i downloaded both needed files: awndatabasemanagement.py upc_db.xml based on this answer , made few edits in awndatabasemanagement.py: line 320 opts['i']='upc_db.xml' instead of opts['i']='e:/usuaris/horacio/arabicwn/awndatabase/upc_db.xml' i added @ end wn.get_synsets_from_word(u"جَÙ…ِيل") i added @ line 2: # -*- coding: utf-8 -*- then ran using: $ python awndatabasemanagement.py -i upc_db.xml , no errors found: <open file 'upc_db.xml', mode 'r' @ 0x10156c270> yet when run original py file: from nltk.corpus import wordnet wn jan = wn.synsets('wait')[0] print(jan) #this works fine print(jan.lemma_names(lang='arb')) #this works fine wn.get_synsets_from_word(u"جَÙ…ِيل") i : `synset('delay.n.01') [u'\u0627\u0650\u0646\u0652\u062a\u0650\u0638\u0627\u0631', u'\u062a\u0623\u062...

java - HTTP 400 Bad request - Only on JBoss Server -

i have rest service class, intends update inventory using put method via rest web service. when call service class junit or main class ( public static void main ) inventory got update , don't issue. but same service class throws exception when it's deployed jboss-eap server , called remote method, see following error in log, http 400 - bad error sun.net.www.protocol.https.delegatehttpsurlconnection:https://www.webstore.com please see below piece of code, url apiurl = new url("https://..."); string authtobytes = username + ":" + password; byte authbytes[] = base64.encodebase64(authtobytes.getbytes()); string authbytesstring = new string(authbytes); conn = (httpurlconnection) apiurl.openconnection(); conn.setrequestmethod("put"); conn.setrequestproperty("accept", "application/xml"); conn.setdooutput(true); conn.setrequestproperty("authoriza...

java - Exiting method and main method do not work -

im making text based adventure game , i'm having trouble exiting game when player's health reaches 0. want exit method , main method , give game on message cant exit method without main looping. here's main method , code combat: i have stats , running static variables boolean running = true; printprogramdescription(); if(running != false) { combat(); } done(); //displays game-over , thank playing } //end of main method public static int[] combat() throws exception { random rand = new random(); string[] enemies = {"skeleton", "zombie", "ghost", "ghoul"}; string[] attackoptions = {"\t1. attack", "\t2. drink health potion", "\t3.run away!"}; boolean run = false; int healthpotiondropchance = 30; //percentage string enemy, strcombat, lowerstr; int enemyhealth, damagetaken, damagedealt; int maxenemyhealth = 60; int enemyattackdamage = 40; system.out.println(""); system.out.println(...

Have Paypal Check Out Button redirect to Payment page with 'Pay with a debit or credit card' heading -

Image
couldn't find definitive answer online. right now, when clicking on 'check out paypal' standard payments button on website, users redirected login page 2 options: 'pay paypal account' or 'don't have paypal account' my question how can 'don't have paypal account?' text instead 'pay debit or credit card' i've seen in screenshots (see below). know login page displays differently depending on users cookies, i've tried different cookie combinations , still can't 'don't have paypal account?' text change. thanks help! if express checkout, may looking adding solutiontype=sole initial setexpresscheckout api request but, screenshot, think bottom accepting credit cards guest checkout / account optional, joining paypal looks "(optional)". when click expand section? keep in mind automatically expanded customers don't have paypal account email stored in browser cookies. (e.g. if brand...

entities - Have Drupal "gray out" certain fields on a web form when the from is being edited for the 2nd time? -

i trying create drupal (entities) web form user can fill out , submit. if user wants edit same drupal form again, how make inputed fields grayed out , non editable when return? also if possible have hidden fields appear when form being edited time other when organically entered? download , enable module "editable fields". then, when editing filed want "grayed out", there option called, "field visibility , permissions". under click on "custom permissions", give option uncheck user's ability edit value field. once done, won't see field on edit form anymore. if want see on edit form "grayed out", download , enable module "field readonly". once enabled, nothing more required do, appear on form, won't able edit it.

ios - Table View Data Loading Multiple Times After Dismissing Modal View Controller -

i have table view displays objects parse. have button modally presents view controller adding new objects. when row in table view selected, modally presents view controller display objects info , allows object edited. issue i'm having when add new item or edit item , dismiss modal controller, table view reloads , displays data multiple times. have done wrong? these functions in presenting view controller (my table view controller). issue has in diddismissviewcontroller(). func getitems() { // activityindicator?.startanimating() let query = pfquery(classname: "items") query.wherekey("user", equalto: pfuser.currentuser()!) query.wherekey("collection", equalto: self.title!) query.orderbyascending("item") query.limit = limit query.skip = skip query.findobjectsinbackgroundwithblock( { (objects, error) -> void in if error == nil { if ...

sql server - How to use parameters in CTE -

this question sql server / tsql. i use following technique in postgres: with i(username, name) (values (?, ?)) insert access_log (username ,name ,uid ) values (select i.username ,i.name ,tab.uid join listofusers tab on tab.username = i.username ) that is: create cte @ top of insert/select parameters passing in. solves handful of problems: it allows using parameter in locations otherwise not allowed. it allows using same parameter multiple times without specifying twice on input. it allows me rearrange ? in select without going code change order of parameters being specified. it allows quick way @ list of being passed in order correct. my question is: how can in t-sql with single statement ? note not asking multiple statement solution. going accept answer can run in single execute statement in jdbc/odbc program , not create temporary tables. i won't flag answers multiple...

reactjs - Redux reducer todolist Immutable equivalent -

i'm trying rewrite redux todo example in immutable.js, far i've made initalstate immutable list , changed add , unshift rather spread operator, seems working fine. form immutable docs seem can use these unshift , push etc.. on list, think might ok?. i've seen examples instead of .list() used .fromjs() wrapping object that's being push / unshift etc in .fromjs() so, question is that's required make immutable ? const initialstate = immutable.list([{ text: 'use redux', marked: false, id: 0 }]); export default function todos(state = initialstate, action) { switch (action.type) { case add_todo: return state.unshift({ id: state.reduce((maxid, todo) => math.max(todo.id, maxid), -1) + 1, completed: false, text: action.text }); case delete_todo: return state.filter(todo => todo.id !== action.id ) case edit_todo: return state.map(todo => todo.id === action.id ? ...

loading - Firebase Rate Limiting -

i'm experiencing huge load times firebase. have 5,000 entries in "users" collection, , working fine until added base64-encoded photo each user. here's summary of code: function initcurrentauth() { return authref.$requireauth().then(attachuserobject); } function attachuserobject(authdata) { getuser(authdata.uid).$loaded().then(function(user) { ...this code never runs because getuser never resolves } } function getuser(id) { userreference = usersref.child(id); return $firebaseobject(userreference); } i'm on free firebase plan, i'm wondering if i'm being throttled? if has insights, appreciated. thanks! not sure if else, in case - frank suggested, did have "listener". had been looking $watch in code trigger it, had $firebaseobject(users) call triggered massive download.

ocr - Can I read this captcha with imagemagick/tesseract? -

Image
i'm week trying read captcha. i'm using imagemagick treat image , tesseract interpret. without success. me? thank you! . convert captcha-novo.png -fuzz -50% -transparent black -fuzz 15% -fill black -opaque 'rgb(16,128,176)' -fuzz 40% -fill white +opaque blue -colorspace gray captcha-interpretado.png . tesseract captcha-interpretado.png page-empty.txt

algorithm - Contextual type for closure argument list expects 1 argument, but 2 were specified -

i'm trying algorithm working swift 2.1: http://users.eecs.northwestern.edu/~wkliao/kmeans/ though getting error on line: return map(zip2sequence(centroids, clustersizes)) { cluster(centroid: $0, size: $1) } here's full function: func kmeans<t : clusteredtype>( points: [t], k: int, seed: uint32, distance: ((t, t) -> float), threshold: float = 0.0001 ) -> [cluster<t>] { let n = points.count assert(k <= n, "k cannot larger total number of points") var centroids = points.randomvalues(seed, num: k) var memberships = [int](count: n, repeatedvalue: -1) var clustersizes = [int](count: k, repeatedvalue: 0) var error: float = 0 var previouserror: float = 0 repeat { error = 0 var newcentroids = [t](count: k, repeatedvalue: t.identity) var newclustersizes = [int](count: k, repeatedvalue: 0) in 0..<n { ...

Android Studio program seems to be getting stuck at HTTPResponse -

i'm working on app in android studio, i'm relatively new , i'm trying pull information website. i'm running problem. code seems sticking @ httpresponse request. i've stuck load of debug logs in , last 1 print "log.v("arg", "trying 2");". i've included applicable code below, can maybe point out i'm doing wrong? appreciated. @override protected string doinbackground(string... medurls) { log.v("arg", "executed"); string medname = "medname"; (string medsearchurl : medurls) { httpclient medclient = new defaulthttpclient(); log.v("arg", medsearchurl); try { log.v("arg", "trying 1"); httpget medget = new httpget(medsearchurl); log.v("arg", "trying 2"); httpresponse medresponse = medclient.execute(medget); log....

ios - Swift: Adding UISegmentedControl/UITextField to dynamic UITableView -

i creating registration form application. app allows users create registration forms, , these registration forms displayed using uitableview. questions can either in form of text input (uitextfield) or multiple choice (uisegmentedcontrol). have question creation working, cannot figure out how display uitextfields , uisegmentedcontrols in uitableview. class use create question: class question { var label: string var required: int // create question init (label: string, required: int) { self.label = label self.required = required if (self.required == 0) { self.label = self.label + " *" } } } class textinput: question { var placeholder: string init (placeholder: string, label: string, required: int) { self.placeholder = placeholder super.init(label: label, required: required) } } class multichoice: question { var answers: [string] init(answers: [string], label: string, required: int) { self.answers = answers super.init(label: ...

return reference to element of dynamic array in C++? -

is how return reference element of dynamically allocated array index ?? int& dynamic_array::operator[](unsigned int i) { if (i >= get_size()) throw exception(subscript_range_exception); else return array[i]; } yes, correct – alexander shishenko thanks

java - Decode UTF-8 String -

import java.nio.charset.charset; import java.security.messagedigest; import java.security.security; import javax.crypto.cipher; import javax.crypto.spec.ivparameterspec; import javax.crypto.spec.secretkeyspec; import org.apache.commons.codec.binary.base64; public class cryptolib { public cryptolib() { security.addprovider(new org.bouncycastle.jce.provider.bouncycastleprovider()); } public string encrypt(string plaintext, string key) throws exception { // convert key bytes messagedigest md = messagedigest.getinstance("md5"); md.update(key.getbytes("utf-8")); byte[] keybytes = md.digest(); // use first 16 bytes (or less if key shorter) byte[] keybytes16 = new byte[16]; system.arraycopy(keybytes, 0, keybytes16, 0, math.min(keybytes.length, 64)); system.arraycopy(keybytes, 0, keybytes16, 0, math.min(keybytes.length, 16)); // convert plain text bytes ...

How to get latest version of android app from Google Playstore? -

question : i want latest version of app in production, google playstore. want add functionality force upgrade, if changes in latest version require it. what have : i updating latest version of app on server, , forcing app request , check version against it. works. not want update on server everytime release new version. want app able pick same information google playstore instead. what need : i can handle logic @ client side (on app). need api call playstore own app's latest production version. if can me pointers on this, helpful. cheers, rohitesh

c - factorial of number using argument recursion(as in function call within argument list) -

my question regarding finding factorial of number using ternary operator in c. code below suggests using recursion, in not function definition, argument list . valid in c ? [note : 0 factorial handled seperate piece of code] the function prototype fact : int fact(int); the definition : int fact(num=(num>1)?num*fact(num-1):1) { return num; } my question is, recursion different instance of same function called within function, can true arguments ? you want this: int fact(int num) { return num > 1 ? num*fact(num-1) : 1; }

c++ string (int) + string (int) -

this question has answer here: how implement big int in c++ 16 answers i have 2 strings, both contain numbers. numbers bigger max of uint64_t . how can still add these 2 numbers , convert result string? well, can either use bigger datatype (for example library deals large integers), or can knock own. i suggest if 1 off, long addition have learned in first few years of school. can operate directly on 2 strings, add columns, 'carry', , build string containing result. can without conversion or binary. here. fun, knocked solution you: string add( const string& a, const string& b ) { // reserve storage result. string result; result.reserve( 1 + std::max(a.size(), b.size()) ); // column positions , carry flag. int apos = a.size(); int bpos = b.size(); int carry = 0; // add columns while( carry > 0...

android - UnParseable date exception at offset 0 java -

i working on android application in trying format date according 2/1/16 5:20 date. getting java.text.parseexception: unparseable date: "2/1/16 5:20 am" (at offset 1). code given below, please me out here. dateformat fafterutc = new simpledateformat("mm dd yy hh:mm aa"); date dselectedafterutc = fafterutc.parse("2/1/16 5:20 am"); your simpledateformat missing /`s: new simpledateformat("mm/dd/yy hh:mm aa")

php - I would like to know how to keep an inventory variable in a class the same for all new objects? -

the problem having keeping inventory variable keep changes made different objects. example, $me object buys 4 items, deducts inventory , leaves 6 in inventory good. make new object $l, inventory starts 10 again, instead of new current inventory of 6. below php code class class cashregister { public $total = 0; public $name; public $discount; public $lastamount; public $inventory = 10; public function __construct($name, $discount) { $this->name = $name; $this->discount = $discount; } public function add($itemcost) { $this->total += $itemcost; $this->lastamount = $itemcost; } public function scan($item, $quantity) { switch ($item) { case "eggs" : $this->add ( 1 * $quantity); $this->inventory($quantity); break; case "news" : $this->add(2 * $quantity); $this-...

python - Sharing numpy arrays between multiple processes without inheritance -

i share numpy arrays between multiple processes. there working solutions here . pass arrays child process through inheritance, not work me because have start few worker processes beforehand , don't know how many arrays i'm going deal later on. there way create such arrays after process started , pass these arrays processes via queues? btw reason i'm not able use multiprocessing.manager .

Convert string into date in SQL Server -

conversion failed when converting date and/or time character string. i'm getting above error when running statement in sql server: select convert(datetime, 'fri, 15 jan 2016 17:30:05 gmt') actually want insert same string format in datetime column as suggested tim biegeleisen, string needs processed converted. in order convert need strip of day ( fri, ) , gmt timezone @ end, example: declare @date varchar(50) = 'fri, 15 jan 2016 17:30:05 gmt' select convert(datetime, substring(@date, 5, len(@date) - 8), 113) this solution strip timezone information, have @ post if want convert utc.

javascript - waypoint addClass and remove class of a "fixed" element works when going down but doesn't going up -

i'm working on website parallax effect using stellar: http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-parallax-scrolling-website-using-stellar-js/ i've got "fixed" div class @ center of page. when scroll down or class changes depending on slide "active". i'm using waypoint , works fine when i'm scrolling down page. when scroll up, instead of changing class, put 1 after other, order shifted , class doesn't match right slide. here html (#square fixed div): <body> <ul class="navigation"> <li id="un" data-slide="1">slide 1</li> <li id="deux" data-slide="2">slide 2</li> <li id="trois" data-slide="3">slide 3</li> <li id="quatre" data-slide="4">slide 4</li> <li id="cinq" data-slide="5">slide 5</li> <li id="six" data-sl...

"ZipException duplicate entry" after upgrading to Android Studio 2.0 Preview 5 -

after upgrading yesterday keep getting these gradle build errors: error:execution failed task ':app:transformclasseswithjarmergingfordebug'. com.android.build.api.transform.transformexception: java.util.zip.zipexception: duplicate entry: xxx/.../xxxactivity$1.class it happens whatever class i'm working on, e.g. activity class. it's super annoying since have clean project before every build. i using: android studio 2.0 preview 5 , gradle:2.0.0-alpha5 . upgrading newly released alpha8 android studio , gradle plugin resolves issue.

ios - UISlider not working, only display half of the track -

Image
upon inserting uislider interface, greeted strange me in interface builder, half of track gone. figured graphical glitch, because quite common interface builder decided preview application. same issue present. so, ran application find out not issue present, uislider not responsive in way, shape, or form. tried moving slider out of nested view make sure nothing blocking touch events it, although no avail. the reason half of track hidden can seen in picture below: as can see selectors, uislider taking half of space should be, on-top of still has it's default values: minimum: 0 maximum: 1 current: 0.5 mode: scale fill enabled: true now strange part know there's nothing wrong uislider whole, because use in other interfaces/views. can seen working below: i'm not sure go here, can't find reason uislider should not work. i'm not using custom views or viewcontrollers in interface, it's just... not working, , no reason. try set minimum...

I am getting an error in my java program as : constructor Try1 in class Try1 cannot be applied to given types; -

i trying implement constructor overloading in java. think perfect shows error: main.java:28: error: constructor tryme in class tryme cannot applied given types; tryme s=new tryme(1,1,2015); ^ required: no arguments found: int,int,int reason: actual , formal argument lists differ in length 1 error . here code: import java.util.*; class try1 { int day,month,year;`` public void try1() { day = 1; month = 1; year = 2015; } public void try1(int d,int m,int y) { day = d; month = m; year = y; } public void seter() { system.out.println(day+"/"+month+"/"+year); } } class mdate { public static void main(string []str) { try1 t = new try1(); t.seter(); try1 s=new try1(1,1,2015); s.seter(); } } constructor not used explic...

javascript - How to pause slideshow when hovering -

how add pause effect when hover on image in jquery slideshow? $(document).ready(function () { slideshow(); }); function slideshow() { var showing = $('#slideshow .show'); var next = showing.next().length ? showing.next() : showing.parent().children(':first'); var timer; showing.fadeout(500, function () { next.fadein(200).addclass('show'); }).removeclass('show'); settimeout(slideshow, 3000); } var hovering = false; //default not hovering $("#slideshow").hover(function () { //*replace body element hovering = true; //when hovered, hovering true }, function () { hovering = false; //when un-hovered, hovering false slideshow(); //start process again }); function slideshow() { if(!hovering) { //if not hovering, proceed /* code here*/ nextslide(); settimeout(slideshow, 1000); } } ...

How To Read ".XML" File Offline Using Pure JavaScript? -

i trying read .xml file feed using pure javascript in pc show data on browser. can view feed.xml file online saved googleblogxmlfeed . can read online via json want read offline after saving them in file feed.xml in pc. possiable or not? if yes guideline...??? you can not access "user" local file system web page. serious security issue (do want web apps able access files on pc while browsing?). if have file on same server app can access it, make sure have file extension in mime-types. ----- adding code based on comments ------- $.ajax({ url: "feed.xml", success: function(xml){ var xmldoc = $.parsexml( xml ), $xml = $( xmldoc ), title = $xml.find( "title" ).text(); console.log(title); } });

javascript - Bootstrap Remote tabs - load first tab -

i'm using bootstrap-remote-data library load data remotely since have load alot of data every tab. my problem whenever page loaded, first tab not loaded when page does; need click tab , first tab in order load first tab. the above library contains feature of "loadfirsttab:" variable can set true or false, no matter if variable true or false - never loads first tab. been trying play js class , html several hours , couldn't make work , load first tab. this how html looks like: <li class="active"><a data-toggle="tab" href="#tab1" data-tab-url="tab1.php">tab 1 - never loaded on page load!</a></li> <li><a data-toggle="tab" href="#tab2" data-tab-url="tab2.php">">tab2</a></li> <li><a data-toggle="tab" href="#tab3">tab 3</a></li> <li><a data-toggle="tab" href="#tab...

c++ - Qt5: How to hide or remove a QMenu from the QMenuBar? -

i using qt5 on windows7 platform: qt creator version is: v3.3.2. qt version 5.5.1 , mingw 32bit. currently, in menu bar have: configuration - reports - help i searched , found possible answer: not possible hide qmenu object qmenu::setvisible()? , it didn't work ... so, trying remove menu using: ui->menuhelp->setvisible(false); and: ui->menuhelp->menuaction()->setvisible(false); unfortunatelly, both failed hide/remove help menu... please, there other way it? [code]: mainwindow::mainwindow(qwidget * parent) : qmainwindow(parent), ui(new ui::mainwindow) { ui->setupui(this); this->setwindowflags(this->windowflags() & ~qt::windowmaximizebuttonhint); if(!server.listen(qhostaddress("192.168.1.2"), 8001)) return; if(true) // testing... ui->menuhelp->menuaction()->setvisible(false); } just test, i've added 3 menus menubar . tried this: ...

java - Javafx Webview Exception -

i trying load page webview. when try load https://www.google.com/ doesn't complain, when try load other sites throws below exception: jan 16, 2016 4:14:20 pm com.sun.webkit.network.urlloader dorun warning: unexpected error java.lang.illegalargumentexception: protocol = https host = null @ sun.net.spi.defaultproxyselector.select(defaultproxyselector.java:176) @ sun.net.www.protocol.http.httpurlconnection.plainconnect0(httpurlconnection.java:1099) @ sun.net.www.protocol.http.httpurlconnection.plainconnect(httpurlconnection.java:999) @ sun.net.www.protocol.https.abstractdelegatehttpsurlconnection.connect(abstractdelegatehttpsurlconnection.java:177) @ sun.net.www.protocol.http.httpurlconnection.getinputstream0(httpurlconnection.java:1513) @ sun.net.www.protocol.http.httpurlconnection.getinputstream(httpurlconnection.java:1441) @ sun.net.www.protocol.https.httpsurlconnectionimpl.getinputstream(httpsurlconnectionimpl.java:254) @ com...

.net - WPF can't find simple resources anymore -

i have simple demo application use testing purposes. added resource dictionary , wpf fails find resources @ runtime. visual studio regards resources fine , shows styles in visual designer, when application run, xamlparseexception saying resource not found. code nothing else other working applications, can't find difference. what's problem that? here's example of resource dictionary appresources.xaml: <resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <!-- there need @ least 2 styles if startupuri not used. --> <!-- see http://bengribaudo.com/blog/2010/08/19/106/bug-single-application-resources-entry-ignored --> <style x:key="__unused"/> <style x:key="infolabelstyle" targettype="textblock"> <setter property="foreground" value="green"/> ...

Swift - Wrong date format (JSON .NET) -

i'm trying make api call alamofire in app, strange error. 'there error deserializing object of type tucson.geocaching.wcf.api.createtrackablelogrequestv1. datetime content '\/date(1452942271163+0500)\/' not start '\/date(' , end ')\/' required json.' on website of api date format must this: "\/date(928174800000-0700)\/" my code: posttblog("gsycnp", text: "test", date: "\\/date(928174800000-0700)\\/", logtype: 48) func posttblog (code: string, text: string, date: string, logtype: int) -> bool { if let apikey = apikey { let url = "https://api.groundspeak.com/livev6/geocaching.svc/createtrackablelog" let parameters:[string : anyobject] = ["accesstoken":apikey, "trackingnumber":code, "utcdatelogged": date, "note":text, "logtype":logtype] alamofire.request(.post, url, parameters: parameters, encoding: .json).re...

c# - How to modify only one or two field(s) in LINQ projections? -

i have linq query: list<customers> customers = customermanager.getcustomers(); return customers.select(i => new customer { fullname = i.fullname, birthday = i.birthday, score = i.score, // here, i've got more fields fill isvip = determinevip(i.score) }).tolist(); in other words, want 1 or 2 fields of list of customers modified based on condition, in business method. i've got 2 ways this, using for...each loop, loop on customers , modify field (imperative approach) using linq projection (declarative approach) is there technique used in linq query, modify 1 property in projection? example, like: return customers.select(i => new customer { result = // telling linq fill other properties isvip = determinevip(i.score) // modifying 1 property }).tolist(); you can use return customers.select(i => { i.isvip = determinevip(i.score); return i; }).tolist();

html - When drawing on a canvas, should calculations be done relative to cartesian plane coordinates? -

i've been seeing lot of canvas-graphics-related javascript projects , libraries lately , wondering how handle coordinate system. when drawing shapes , vectors on canvas, points calculated based on cartesian plane , converted canvas, or calculated directly canvas? i tried playing around drawing circle graphing tangent lines until line intersections start resemble curve , found difference between cartesian planes i'm familiar , coordinate system used web browsers confusing. function circle, example, "y^2 + x^2 = r^2" need translated "(y-1)^2 + (x-1)^2 = r^2" seen on canvas. , negative slopes positive slopes on canvas , upside down :/ . the easiest way me think pretend origin of cartesian plane in center of canvas , adjust coordinates accordingly. on 500 x 500 canvas, center 250,250, if ended point @ 50,50, drawn @ (250 + 50, 250 - 50) = (300, 200). i feeling i'm over-complicating this, can't wrap mind around clean way work canvas. cu...

c++ - Creating unsigned 80 bit variable -

how can create 80 bit unsigned variable? after creating, need shifting operation in case; unsigned long long key=0x00000000000000000000 valid? there const unsigned __int64 ; can change unsigned __int80 ? your fundamental data types limited architecture of computer, 8-bit, 16-bit, , 32-bit integers, , possibly 64-bit integers. some machines have clever extensions 128-bit integers, on others have compose types achieve that, done in background so-called "bigint" libraries. might, example, wrap 2 64-bit integers "128-bit integer" class transparently handles carry-over when incrementing/decrementing resulting value. there's no particular reason can think of can't apply same logic "bigint" class wraps 64-bit integer , 16-bit integer, or 5 16-bit integers — best depends on use case, try both , measure. i boost.largeint 1 , write typedef large_int<uint64_t, uint16_t> uint80_t; on writing program. as happens, library has exam...

php - insert data in corresponding tables from multistep form -

i have multistep form called "card" this form must contain sevral information of person, person has done, job of person, tools person used etc. to solve , make more cool made multiform step form, when user finishes filling data first table (for instace information of tools used) user clicks on next step button , inputs other table showed (project person has worked)... keeps on going till user fills necessary data. save work using grocerycrud. <form method="post" action="<?php echo base_url();?>controller/save" name="form"/> <label>user name</label> <input type="text" name="username"> <input type="submit" value="add"/> <!--####################### several more data store in distict tables ####################### --> </form> in controller: function save { $arrdata["username"] = $this->input->...