Posts

Showing posts from March, 2015

How can I use unicode \u003c in C++? -

i want use unicode \u003c in c++ this. const static string strunicode = "\u003c"; but got error when compiling. error: \u003c not valid universal character i found unicode character between \u0001 , \u009f lead same compiled error. bug? how can use these unicode character in c++ correctly?

database - C# Oracle OracleDataReader.Read() -

i've ran little problem oracle , c#. when i'm running query returns 0 rows, rd.read() = false. it's weird, because there records in database. running exact same query in sql developer returns 2 rows. i'm running oracle xe 11.2 can maybe explain why dr.read() returns false? edit: connecting database works 100%. public list<chatmessage> receivemessage(string account_id, string account_id2) { //initialize list of strings messages list<chatmessage> list = new list<chatmessage>(); //make connection oracleconnection con = new oracleconnection(connstring); con.open(); //make query string query = "select sender_id, receiver_id, message, msg_date tbl_chat sender_id = '1' , receiver_id = '2' or sender_id = '2' , receiver_id = '1' order msg_date desc"; //add parameters oraclecommand cmd = new oraclecommand(); //cmd.param

javascript - jQuery on click run functions inside twice -

is possible run functions twice on click function? example: $('a').click(function(){ function1(); function2(); }); this should run function1(); function2(); , again function1(); function2(); try bind events twice , if want run function more twice preferred way looping. function twice(){ function1(); function2(); } $('a').click(twice).click(twice); demo

php - Using Facebook graph API, error when trying to get friends list -

i using php facebook php sdk my code: session_start(); require_once __dir__ . '/vendor/autoload.php'; use facebook\facebookrequest; $fb = new facebook\facebook([ 'app_id' => 'xxxx', 'app_secret' => 'xxxx', 'default_graph_version' => 'v2.5', ]); i able log in facebook account, having trouble getting user friends list. this how i'm doing it: //get friends list $session = $_session['facebook_access_token']; $request = new facebookrequest( $session, 'get', '/me/taggable_friends', array( 'fields' => 'name,picture' ) ); i took code facebook graph explorer , on there working perfectly. i getting following error: catchable fatal error: argument 1 passed facebook\facebookrequest::__construct() must instance of facebook\facebookapp , string given, called in /applications/xampp/xamppfiles/htdocs/project/index.php on line 76 , de

java - Inputs are not Storing in database while uploading an image -

i trying insert data's , image path database. image name , path getting stored in database , remaining column null can please me out below servlet , im new jsp , servlet protected void processrequest(httpservletrequest request,httpservletresponse response) throws servletexception, ioexception { throws servletexception, ioexception { string title = request.getparameter("title"); string keyword = request.getparameter("key"); string message = request.getparameter("mess"); if(servletfileupload.ismultipartcontent(request)){ try { list<fileitem> multiparts = new servletfileupload(new diskfileitemfactory()).parserequest(request); for(fileitem item : multiparts){ if(!item.isformfield()){ string name = new file(item.getname()).getname(); item.write( new file(

Scroll to bottom of ScrollView in React Native -

i find way programmatically scroll bottom of scrollview. aware of scrollto method after looking @ source code scrollview, cannot seem find way measure content size of scrollview. after looking around, came across this github issue mentions @ how "uimanager.measurex methods used" measure content size. after searching several times through source code, cannot quite seem find these methods used. would able point me in right direction? it pretty consealed , ran source code. you can try this: require: var rctuimanager = require('nativemodules').uimanager; render: <scrollview ref = {component=>{this._scrollview=component;}}> </scrollview> event: someevent: function() { rctuimanager.measure(this._scrollview.getinnerviewnode(), (...data)=>{console.log(data)}); } from data, can contentsize of scrollview height fourth element of data . of course can content offset it. run source code of rctuimananger.m more details. when

Difference between common.inc.php and common.php -

i know difference between using common.inc.php or common.php include files in php. is semantic or there reason use 1 or other? using inc.php people indicate file meant included in script , not accessed directly. stated, not affect functionality in way. users can still execute file via web browser. it's been while since i've seen practice used, it's used in procedural programs. oop programs have file associated each class, name matching of class, such user.php , post.php etc.

python - function return value from singleshot call -

i new python. have created ui file in qt designer , using in python. in order let gui update, using singleshot; self.labletop.settext('starting program... please wait') self.texteditinfo.append('mem programming started') qtcore.qtimer.singleshot(1000, lambda: self.programmem()) where programmem function returns 0 on success. there way can return value of function using above call. right way let gui updated before calls function? many thanks. ok, found answer. no need singleshot. trick call qtgui.qapplication.processevents() for update.

R: Obtaining a Sample and putting it into a Group -

so i've got random sample standard normal distribution, (call x) had order it, , put ordered vector 10 groups first group contains 10 lowest , on. have create new vector such in order of x, value in y group number value of x in. i.e first 3 values in x in groups 2,5 & 4 respectively, first 3 values in y 2,5,4... can give assistance code , see i've gone wrong? x<-rnorm(100, mean=0, sd =1) y<-(c(x)) datart<-x[order(x)] datart v1<-datart[1:10] v2<-datart[11:20] v3<-datart[21:30] v4<-datart[31:40] v5<-datart[41:50] v6<-datart[51:60] v7<-datart[61:70] v8<-datart[71:80] v9<-datart[81:90] v10<-datart[91:100] (i in y) { if (i<-v1) print(1) else if (i<-v2) print(2) else if (i<-ve) print(3) else if (i<-v4) print(4) else if (i<-v5) print(5) else if (i<-v6) print(6) else if (i<-v7) print(7) else if (i<-v8) print(8) else if (i<-v9) print(9) else if (i<-v10) print(10) }

symfony - separate a website functions into group -

i using symfony2, need separate functions of website in groups, store can use function when group of function owned store, use case quite simple, when try design way this, find quite nasty. original idea check whether group owned store in every action, ,every action function, means have mark group actions, design need tremendous work, have better idea this? searched lot, didn't find bundle , or resource this, seems use case edge. if i've understood question need have role-based access specific actions or set of actions. so, can start creating controller each set of actions prefix identifies relative set. 1 - creating controller group of actions use sensio\bundle\frameworkextrabundle\configuration\route; use sensio\bundle\frameworkextrabundle\configuration\method; /** * @route("/store") */ class storecontroller extends controller { /** * @route("/foo/{bar}") * @method({"get", "post"}) */ pub

java - Changing text on a JLabel from another class -

so, have been trying figure out little bit , cannot figure out how it. want 1 of buttons in class change text of jlabel in gui class. here code gui class:`import java.awt.container; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jtextfield; public class gui extends jframe{ container pane = getcontentpane(); jbutton guess = new jbutton("guess"); jbutton gen = new jbutton("generate number"); jtextfield userinput = new jtextfield(); jlabel numbers = new jlabel("press generate start."); jlabel guessednum = new jlabel(""); jlabel error = new jlabel(""); public void creategui(){ final int width = 325; final int height = 200; final int centerwidth = width / 4; final int centerheight = height / 4; guesshandler guesshandle; genhandler genhandle; pane.setlayout(null); guesshandle = ne

javascript - Datatables Expand All on multiple pages functionality -

i implementing expand functionality of rows in datatable. have functionality implemented each individual row in datatable + sign, when click there row expands. each row has onclick javascript function. while implementing expand all rows in page 1 gets expanded. on page 2 rows stay closed. should doing onclick function gets called on page 2 well. here code expand all. jquery('body').on('click','#expandall ',function(){ var rows = jquery("#sortable_mappedtable").datatable(); jquery.each(rows.fngetnodes(), function (i, row) { var id = jquery(this).find('.datatoggle.datatoggleclosed').trigger("onclick"); }); });

c# - Saving to database, then reading from database, data is not there -

i have page, user can modify it's information. when page loads, fills in users information text input fields. can change information , hit save. data should saved database , should reflected in text fields, because of refresh. not save data. if remove reading of data, data saved when button clicked, when data reading there, data not saved. this code in "read data" part, in page_load(): string loggedinuser = system.web.httpcontext.current.user.identity.name; sqlconnection connectdb = new sqlconnection("data source=serverhere;initial catalog=cataloghere;user id=usernamehere;password=passwordhere;"); //opretter database connection string sqldatareader inforeader = null; sqlcommand getuserinfo = new sqlcommand("select firstname,lastname,age,city,contact,bio userinfo username = @username", connectdb); getuserinfo.parameters.add("@username", loggedinuser); connectdb.open(); inforeader = getuserinfo.executereader();

visual studio - Application freezes when I do resuming - Windows 10 Mobile - C# -

when open app (universal app windows 10 / windows 10 mobile), work perfect when go using native hardware key until exit application, application freeze when resuming (long press key , select app exit before). i have build 10572. same app, in pc version, works perfect. problem build mobile, since still preview? or problem using native hardware key exit application? the strange thing when "run" through visual studio, application not freeze, when run out of vs application has problem! someone can me? thanks

swift - checking if generic Type is of s specific Type inside class -

assuming have following protocol , class: protocol numeric { } extension float: numeric {} extension double: numeric {} extension int: numeric {} class numericprocessor<t:numeric> { var test:t func processstring(stringvalue: string?) if t double { test = double(stringvalue) } } } what want convert string spesific t:numeric. test = t(stringvalue) will not work although double(stringvalue), float(stringvalue) work. if t double { test = double(stringvalue) } does not work because t double can`t asked. how possibly approach problem in generic numeric class? edit i'm idiot. can add initialiser protocol protocol numeric { init?(_ s: string) } extension float: numeric{} class numericprocessor<t:numeric> { var test:t? func processstring(stringvalue: string?) { test = t(stringvalue!) } } let n = numericprocessor<float>() n.processstring("1.5") print("\(

javascript - After user defined event, wait for other outside event -

i have query running in background retrieve user emails large database collection. the user can enter email address field , click submit, query getting email accounts might not complete yet, , want make sure user defined email address has not been taken. after user clicks submit, how can wait query return?

c# - IIS net.tcp binding not available -

we received new application server , installed iis , web deploy. while configuring new site, noticed can't add net.tcp binding. only http , https available. what have net.tcp available dropdown list? unfortunately, couldn't find online. thanks in advance

python - How to implement about calculating weighted average if it's without for loop -

this code following: students = [{'name': 'tom', 'subjects': {'math': 50, 'english': 100, 'science': 72}}, {'name': 'alex', 'subjects': {'math': 100, 'english': 90, 'science': 95}}] weighting_coefficient = {'math': 2, 'english': 10, 'science': 8} total = sum(weighting_coefficient.values()) index, student in enumerate(students): subjects = student['subjects'] weighting_score = 0 subject, score in subjects.items(): weighting_score += weighting_coefficient[subject] * score students[index]['weighted_average'] = float(weighting_score)/total print students the result: [{'name': 'tom', 'subjects': {'engl

excel - Create charts using dynamic ranges -

i'm having problems using vba in excel create charts using dynamic ranges. need chart results of each of compounds each sample. both number of samples , number of compounds can vary. example of datasheet can found here . a sample of code tried write, range has not been defined: sub graph() dim r range dim c range dim wks worksheet set wks = activesheet ' ' graph macro ' set r = range("b2").end(xldown) set c = range("d2").end(xltoright) activesheet.shapes.addchart2(201, xlcolumnclustered).select activechart.setsourcedata source:=range("wks!$b$2:b" & r, "wks!$p$2:p" & c) ' end sub could point me in right direction? try sub instead: sub graph() activesheet.shapes.addchart2(201, xlcolumnclustered).select [a1].currentregion activechart.setsourcedata source:=range(.resize(, 1).offset(, 1), .offset(, 3).resize(, .columns.count - 3)) end end sub

reporting services - Adding values to a Report when there is no Data in query SSRS -

Image
i have query returns sales representatives number, category, sales. the result this: there 4 categories called g1,g2,g3,g4 . as can see sales representative 11 sold 10 each category (yellow rows). representative 12 sold category g3 , g4 . the idea show in report categories , populate 0 did not sell on particular category. it must grouped sales representative if make tablix grouping sales representatives have this: but want this: is there expression use add these? what did far create group, group of course sales representatives , combine cells column , created row group each category, this: but if execute report repeat categories g1,g2... each time category exists particular sales representative. another problem is, how can evaluate hardcoded category in report if not exist in datasource cant make iif("g1" = fields!category.value,fields!sales.value,"0") not comparing g1 null or isnothing , comparing exists. i think can a

algorithm - how can I use multithreading to compute the intersection on a very large dataset -

i have file composed of 4 millions sets. every set contains 1 n words. size of file 120 mb. set1 = {w11, w12,...,w1i} set2 = {w21, w22,...,w2j} ... setm = {wm1, wm2,...,wmk} i want compute intersection between sets. set 1 ∩ {set1,...,setm} set 2 ∩ {set1,...,setm} ... set m ∩ {set1,...,setm} every operation takes around 1.2 seconds. did following: divide 4 million sets 6 chunks. every chunk containing 666666 sets then following. in here i'll creating 36 threads , i'll computing intersection between chuncks. slow , complicated problem. vector<thread> threads; for(int = 0; i< chunk.size();i++) { for(int j = 0; j < chunk.size();j++) { threads.push_back(thread(&transform::call_intersection, this, ref(chunk[i]),ref(tmp[j]), chunk(results))); } } for(auto &t : threads){ t.join(); } do have idea on how divide problem sub-problems , join of them in end. way in linux too? sample the first column represents id

component loads in localhost but gives internal server error on live : joomla -

i have simple component 1 php file returns data database. file called using js ajax homepage, , works when hosted locally. but on deploying live server, ajax call returns : "failed load resource.internal server error occurred 500". i have tried giving permissions , re configuring htaccess.txt file..but vein.. example: localhost:1000/index.php?option=com_comp&option=raw --- works web.azurewebsites.net/index.php?option=com_comp&option=raw --- dosent work try calling ajax php file directly on live website , see kind of error returns, , whether works or not. i think real problem ajax's url wrong , referencing local server instead of remote server. ps: make sure prepend http:// (or https://, if you're using https) ajax url in code.

angularjs - Audio-element in HTML code but not visible -

when add audio-tag in sourcecode/html, not visible in browser. when manually add html in existing html-page, audio-element not shown. when add text example strong-element, appear expected. in case used angular.js add audio-elements after loading data dynamically. in sourcecode according element inspector chrome/firefox, audio-element not visible . the audio-element visible when loading in static page. is possible add audio/video-element dynamically? maybe if puts controls="control" in audio tag see controls

java - Incorrect return on binary to dec converter -

fixing , tidying converter when noticed somehow gives out incorrect conversions. for example, when creating new number convert using binarynumber bn1 = new binarynumber("1011"); , asking give out result system.out.println(bn1.converttodecimal()); prints out 3 instead of correct result of 11. i'm sure got actual conversion wrong going through in head can't find mistake. public class binarynumber { private string n; public binarynumber(string pn) { n = pn; } public string getn() { return n; } // creating .converttodecimal() public int converttodecimal() { int bitposition = 0; int sum = 0; (int = n.length() - 1; >= 0; i--) { sum = sum + (int) math.pow(2, bitposition) * (n.charat(i) - 48); } return sum; } // creating .add add 2 different binary numbers after // converting public int add(binarynumber bn2) { return converttodecimal() +

How to filter nested documents in elasticsearch? -

i have documents looks { "_id": "56161cb3cbdad2e3b437fdc3", "_type": "comunity", "name": "public", "data": [ { "title": "sonder", "creationdate": "2015-08-22t03:43:28 -03:00", "quantity": 0 }, { "title": "vule", "creationdate": "2014-05-17t12:35:01 -03:00", "quantity": 0 }, { "title": "omer", "creationdate": "2015-01-31t04:54:19 -02:00", "quantity": 3 }, { "title": "sonder", "creationdate": "2014-05-22t05:09:36 -03:00", "quantity": 3 } ] } the mapping: comunitydocument": { "_source": { "includes":

How to set the override the redis host name for different environments in Azure web role project? -

azure redis cache: i implementing redis cache maintaining session state our site. our site azure web role project , configurations in *.cscfg files different environments. wondering how can set host different values different environments. example sample-int.redis.cache.windows.net, sample-test.redis.cache.windows.net, sample.redis.cache.windows.net , able use other attributes web.config file: <sessionstate timeout="5760" mode="custom" customprovider="mysessionstatestore"> <providers> <add name="mysessionstatestore" type="microsoft.web.redis.redissessionstateprovider" host="sample-int.redis.cache.windows.net" accesskey="r7gduggfxirjlmz5wsq1vacnjaawcjjiixzcan2dswm=" ssl="true" /> </providers> </sessionstate> i put redis configuration in web.config , per environment transformation files. don't put application settings data in .cscfg files.

java - Access JDBC methods from another class within the same package -

i have database class imports java.sql.* , have following variables connection connect; preparedstatement statement; resultset result; public database() {} //constructor connect db [successful connection] now create instance in class database db = new database(); , , have this: statement = connect.statement("sql query"); but in class, have this: db.statement = db.connect.db.statement("sql query"); it showing error looks weird. i think possible solution create local variables in class connection connect = db.connect; preparedstatement statement = db.statement; which makes database useless class. there misunderstanding in approach statement = connect.statement("sql query"); <--wrong statement statement = connect.preparestatement("sql query"); <--correct statement so in class should db.statement = db.connect.preparestatement("sql query"); <--worked

asp.net mvc - Does using session state=StateServer and cookieless=true still store cookies on the user's computer? -

in looking @ persisting user information across web session (.net mvc), if use state server , set cookieless=true, there still cookie stored on user's system, relates .net authentication, etc. we use state server store have been used in session object. i realize cookies - ie, antixsrftoken , __requestverificationtoken. apart these, looking cookieless solution. thank you. if use state server , set cookieless=true, there still cookie stored on user's system? this question incomplete. i can give answer you're looking for: when using cookieless=true , asp.net not use cookies on client machine store session id. all setting in regard cookies. if use user controls or application code use cookies, unaffected setting - such cookies still sent visitor's machine.

node.js - Unexpected behavior of util.inspect -

util.inspect seems behave differently in node repl , custom repl $ node > require("util").inspect([]) '[]' > output in custom repl $ node repl.js > require("util").inspect([]) 'array []' > content of repl.js var repl = require('repl'); repl.start({ input: process.stdin, output: process.stdout }); i can't duplicate current master branch. '[]' in both cases. my guess fixed in 089d68861 .

c++ - WinAPI equivalent of Win32_ComputerSystem.PCSystemType -

my app needs check if computer laptop, find accessing property through wmi hard , slow, there win32 equivalent? i've searched on getsystempowerstatus isn't 'foolproof' workstation may have battery, accessing wmi worked me i'm porting app c# , c++ isn't friendly wmi. is there win32 api can use? or property takes guess battery api's?

javascript - Difference between $rootScope and $rootScope.$root -

is there difference between $rootscope , $rootscope.$root? what difference between $rootscope.global.flag = true , $rootscope.$root.global.flag = true do both of them access same variable in rootscope? if so, there particular situation have use either of them? all scopes in angular instances of same prototype. such, global service $rootscope same type of object created directives , passed link function $scope , or controllers. the property $root part of prototype , available on scopes. the $rootscope first scope created angular. scopes created using $new method existing scope. $rootscope special case because it's created before angular.run() executed on modules. when check value of $scope.$root references same instance provided root scope service $rootscope . therefore; console.log($rootscope === $scope.$root); // print true or in example; console.log($rootscope === $rootscope.$root); // print true so yes, variables in root scope same no

c++ - Retrieve the name of the computer and saved it in a variable -

this question has answer here: how compare strings? 6 answers i'm learning win32 programming c/c++. in process of learning, teacher wanted write simple program can shows name of computer runs on , then, if name of target computer "user", shows warning in output console. written following code, doesn't work. myfunction code : tchar * getcomputername() { bufcharcount = info_buffer_size; if (!getcomputername(infobuf, &bufcharcount)) printerror(text("getcomputername")); return (tchar*)infobuf; } calling code : if (getcomputername() == (tchar*)"user") { printf("target os detected \n"); } how can fix issue? there several issues code posted. blatant 1 use of tchar s. tchar invented, before win9x had unicode support, in attempt keep code source

python 3.x - Using BeautifulSoup, Requests and Selenium. Only get the new links in an infinitely srolling web page -

is possible using beautifulsoup, requests , selenium new links in infinitely scrolling web page? for example image links , need them, scroll down , more load how can new ones load? i think compare links new 1 inefficient presume.

entity framework 6 - IManifestTokenResolver for Database First Model? -

we need option set providermanifesttoken in code database first model in order override value edmx, defaults "2012" sql server 2012 in our particular case. what we've tried far: described in this post decorated our context class dbconfigurationtype attribute, our derived class looks same in post. internal sealed class mydbconfiguration : dbconfiguration { public mydbconfiguration() { //this.adddependencyresolver(new singletondependencyresolver<imanifesttokenresolver>(new manifesttokenservice())); this.setmanifesttokenresolver(new manifesttokenservice()); } } as can see, tried 2 different things here, adddependencyresolver , setmanifesttokenresolver. when start application program execution enters constructor of mydbconfiguration - , that's it, dependency resolver itself internal sealed class manifesttokenservice : imanifesttokenresolver { private const string sqlservermanifesttoken = @"2005"; private static r

jquery - Error with Javascript on Partial Page Update -

i have scripts needs run when partial page changes. on 1st page load seems working fine after partial page updated javascript stopped working 1st try: tried put javascript in partial page not working 2nd try: tried put javascript on parent page partial page upadted code load partial page: @html.dropdownlist("usertype", directcast(viewbag.usertype, selectlist), new {.onchange = "changeusertype(this.value)"}) <div id="rendertreeview"> @html.partial("_treeview") </div> <script> function changeusertype(usertype) { $('#rendertreeview').load("/usermaster/changepermission?iusertypeid=" + usertype); } //and somme of other javascript function create tree view </script> this script doesnot work on partial page update <script> $(document).ready(function () { $('#check-all').click(function () { $("input:checkbox").attr('

oracle - Fetching Column with table name alias is not working in VBA -

i trying connect oracle table through vba , fetching data. situation reference 1 table multiple times pivot. while running query via vba it's throwing error fetching data through table alias: below dummy code. sub button1_click() dim strdatasource, strusername, strpassword, strconnectionstring, strquery string dim objadodbconnection, objadodbrecordset object strdatasource = "xxxx" strusername = "xxxx" strpassword = "xxxx" strconnectionstring = "provider=msdaora;data source=" & strdatasource & ";persist security info=true;password=" & strpassword & ";user id=" & strusername set objadodbconnection = createobject("adodb.connection") objadodbconnection.open strconnectionstring set objadodbrecordset = createobject("adodb.recordset") strquery = "select t1.column1 table1 t1 column2='xxxx' , column3

javascript - Root element ID differed from reactRootID -

have react.js component makes 3 ajax calls inside of componentdidmount method , sets state based on result of each call. error in title appeared when "chained" calls execute in specific order. if execute without chaining there no error doesn't work 100% because there no guarantee complete before b , b complete before c. why react complaining root element id? componentdidmount() { var self = this; // doesn't produce error not acceptable $.ajax({.. ..}).done(function(result) { self.setstate({a: result}); }); $.ajax({.. b ..}).done(function(result) { self.setstate({b: result}); }); $.ajax({.. c ..}).done(function(result) { self.setstate({c: result}); }); // chaining doesn't work //self.geta(); // root element id differed reactrootid } geta() { var self = this; $.ajax({...}) .done(function(result) { self.setstate({a: result}); self.getb(); }); } getb() { var self = this; $.ajax({...}) .done(f

I am using twitter bootstrap i want to hide the vertical line when mobile screen -

i want hide vertical line when mobile screen using twitter bootstrap .mycontent-left { border-right: 1px dashed #333; } <div class="row"> <div class="span6"> <div class="mycontent-left"> </div> </div> <div class="span6"> <div class="mycontent-right"> </div> </div> </div> i guess can use media query hinted here . @media (min-width: 768px) { .mycontent-left { border-right: 1px dashed #333; } } you may experiment , change markup like: <div class="row"> <div class="col-xs-6 mycontent-left"> left </div> <div class="col-xs-6"> right </div> </div> here 1 jsfiddle you. i friendly recommend familiar grid system bootstap introduces responsive utilities .

css - Flip animation works OK in Chrome but not in Safari -

i have following fiddle: http://jsfiddle.net/mauricederegt/hy2dvl1u/43/ when open in chrome , click card flip , move right. looks ok in chrome, when in safari (v9) animation kinda sucks (it has clipping etc, click faster see mess-up better) part of css (please see whole in fiddle): /* entire container, keeps perspective */ .flip-container { perspective: 1000; transform-style: preserve-3d; } /* updated! flip pane when .flipped class applied */ .flip-container.flipped .back { transform: rotatey(0deg); } .flip-container.flipped .front { transform: rotatey(180deg); } .flip-container, .front, .back { width: 7.1428rem; height: 10rem; } /* flip speed goes here */ .flipper { transition: 200ms; transform-style: preserve-3d; position: relative; } what missing? why flipping animation bad in safari? kind regards, ps. don't use -webkit- prefix since shouldn't needed anymore try it /* entire contai

android - generic thread framework vs asynctask -

i have few questions the usages of generic thread framework(for specific amount of jobs of course) vs usage of many asyntasks. know if better have many asyntasks small jobs, handler thread when job takes bit longer or better have generic thread having generic jobs notification system built on top of the running thread(or subclass, same story). my idea creating thread handles different jobs without knowing beforehand jobs. goes in direction of creating sort of small framework handling different generic jobs. example approach goes in direction of code below: public (abstract if want extend , add on top) class workerthread extends thread { private static final string tag = workerthread(); private list<worktask> syncqueue = new arraylist< worktask >(); private boolean clearqueue = false; public workerthread() { } public void stop(boolean clear) { clearqueue = clear; this.stopworker = true; } public void ad

c# - Release original ImageSource after a TransformedBitmap is constructed from it -

background: i'm building application open potentially large number of photos, generate thumbnail present user, allow things exif data viewing/clearing , minor post processing. want allow user scroll through images without pausing load each 1 becomes visible, don't want keep dozens or hundreds of full size bitmap images in memory. i had built prototype of task using system.drawing using image objects , generatethumbnailimage method, decided move wpf , use system.windows.media.imagesource derived objects , transformedbitmap scaledtransform generate thumbnail. what found, though, when create transformedbitmap , has reference source image, available , still present in memory. how release source object? some relevant c# code: using system.windows.media; using system.windows.media.imaging; using system.io; using system; ... private void loadimage(){ //called class internally handle generating thumbnail //intent keep metadata , thumbnail bitmap in memory

html - 404 not found - but most certainly on server -

Image
hello, i getting 404 not found error, while file on server. other files can found, tried adding icon folder , since every file upload server cannot found browser. how possible , can fixed? kind regards, isaiah van hunen p.s. of course free visit website , possibly find out what's going on. maybe bad setting? didn't change though. via directadmin (ftp shows same), directly on website have try give folder right permissions can used via web ? type of server running on ? https://serverfault.com/questions/357108/what-permissions-should-my-website-files-folders-have-on-a-linux-webserver

php - foreach loop keeps repeating from beginning inside for loop? -

after executed query, used foreach ($result $row) data each found row database , used inside loop, had no problem. $sql="select * post order id desc"; $result = $conn->prepare($sql); $result->execute(); $num_rows=$result->rowcount(); for($i=1;$i<=$num_rows;$i++){ foreach ($result $row) { echo "$i - $row[posttile]";break 1; } } result looks this: 1 - post 2 - post b ... however, applied principle print each value in array, foreach loop keep repeating start: for($i=1;$i<=$num;$i++){ foreach($array $post){ echo "$i - $post";break 1; } } but result kept printing post every time? 1 - post 2 - post 3 - post ... how fix code to achieve desired outcome?

android - How to make the second navigation drawer NOT cover the app bar? -

i've been dealing drawerlayout , navigationviews , don't seem ba able solve issue. according google guidelines first navbar should cover app bar , second 1 should not. how achieve that? whatever either makes both of them cover or both of them not cover app bar. since navigation view pretty new not suitable answer googling , exploring overflow.com. guide, help, tutorial, sample... highly appreciated. thanks before. here activity.xml <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- main content view, view below consumes entire space available using match_parent in both dimensions. --> <linearlayout android:orientation="

jQuery: How to execute a code after pressing 2 or more keys? -

remember how execute cheat on gta? want execute code in jquery when pressed combination of keys. possible in jquery? example, want display alert when press ctrl + h + e + l + l + o . can teach me how it? tested , working: var combo = 'hello'; var keys = []; function onkeyup(evt) { if (!evt.ctrlkey) return; keys.push(string.fromcharcode(evt.keycode).tolowercase()); if (keys.length > combo.length) keys.shift(); if (keys.join('') == combo) //you have match }

javascript - Append to single element of array -

having trouble ‘p’ element value being appended both ‘reviewer-meta’ blocks. think issue may in append function 'p' element being appended review-comment-wrap elements. how append block element value b removed? <div class="reviewer-meta"> <div class="author-attribute">value a</div> <div class="author-attribute">value b</div> <div class="review-comment-wrap">some value</div> </div> <div class="reviewer-meta"> <div class="author-attribute">value a</div> <div class="review-comment-wrap">some value</div> </div> function runprogram(){ var theelements = $('.reviewer-meta').find('.author-attribute'); $(theelements).each(function(){ if(this.innerhtml == "value b"){ $(this).remove(); } }); $('.review-comment-wrap').append('

javascript - d3.js:Add color to axes dynamically -

i trying create line chart in d3.js.the color of axes chart available @ runtime , can vary in vast set of colors.it possible set colors axes using css classes this . but since range of colors chart can take vast , available @ runtime, not feasible use solution.using call(yaxis).style("stroke",usercolor) sets color font use on axes labels , ticks not color of axis itself. is possible set color of axis in d3.js axis dynamically using javascript? i think might want following: d3.selectall('.axis path') .style("stroke", usercolor) .style("fill", usercolor) in case, .axis path should identifying css on axis lines (possibly put in d3 in yaxis function). need 1 of fill , stroke , try out see works you. should operate on actual axis line, rather text element

c++ - how to create my own 'cout' and 'cerr' class -

how create own class behaves like: std::cout & std::cerr . i writing mini operating system , requirement, having these modules there. the code like: mynewcoutclass mycout; // create cout behavioral class mynewcerrclass mycerr; // create cerr behavioral class mycout << somestring << endl; // prints string mycerr << somestring << endl; // prints string error these objects std::ostream s. can create own std::ostream . precisely how that'll work depends entirely on data sink, haven't specified, std::ostringstream enough started on testing code uses it. however, if literally wish reinvent std::cout , don't . data sink magic file handle stdout , can't recreate it's provided os. create std::ostream steals buffer std::cout what's point?

ios - Remove UINavigationBar back button title -

is there way remove title of button items in all view controllers of app? note : important thing all word. closest i've been this solution : [[uibarbuttonitem appearance] setbackbuttontitlepositionadjustment:uioffsetmake(0, -60) forbarmetrics:uibarmetricsdefault]; but mention in comment there's issue large titles being pushed right solution not valid. just set title of button "" here's example in swift self.navigationitem.backbarbuttonitem = uibarbuttonitem( title: "", style: uibarbuttonitemstyle.plain, target: nil, action: nil) to in view controllers, make baseviewcontroller include line in viewdidload method. when have viewcontroller subclass baseviewcontroller . your solution work if move x value -150, me sounds hack because still showing time, off view bounds.

iostream - How to use cin.fail() in c++ properly -

i'm writing program integer input user cin>>iusersel; . if user puts in letter, program goes infinite loop. tried prevent code below, program goes infinite loop , prints out "wrong! enter #!". how can fix program? cin>>iusersel; while (ivalid == 1) { if (cin.fail()) { cin.ignore(); cout<<"wrong! enter #!"<<endl; cin>>iusersel; }//closes if else ivalid = 0; }//closes while i found information on @ correct way use cin.fail() , c++ cin.fail() question , didn't understand how use them fix issue. after cin fails need clear error flag otherwise other input operation non op. clear error flags need call cin.clear() . code become cin >> iusersel; while (ivalid == 1) { if (cin.fail()) { cin.clear(); // clears error flags cin.ignore(); cout << "wrong! enter #!" <&l

recursion - Java Binary tree insert is not working properly -

when add node example, named "bob" in insert method: public void insert(string alabel){ //left recursion: if(this.getlabel().compareto(alabel) <= 0) { if (childrenleft == null) { bstreenode anode = new bstreenode(alabel,this); return; } else { childrenleft.insert(alabel); } } //right recursion else { if (childrenright==null) { bstreenode anode = new bstreenode(alabel,this); return; } else{ childrenright.insert(alabel); } } } my tree adds blank node no label on left side of treee only. there wrong (bstreenode anode = new bstreenode;)? because when hard code nodes like: bstreenode louis = new bstreenode("louis", treeroot); bstreenode bonny = new bstreenode( "bonny", treeroot); bstreenode sue = new bstreenode("anne", bonny); bstreenode sam = new bstreenode("sam",louis); bstr

android - Since marshmallow update Bluetooth discovery using BluetoothAdapter.getDefaultAdapter().startDiscovery(); is broken -

i have app using bluetooth , connecting devices, can'f find devices using bluetoothadapter.getdefaultadapter().startdiscovery(); worked fine before discovery. tried other apps, doesn't work in other apps well. device try pair (arduino bt-module) can found in android settings. idea try? implemented described on http://developer.android.com/guide/topics/connectivity/bluetooth.html , worked before update. bluetooth adapter has been change in android 6.0 you need set permission access_fine_location or access_coarse_location permission , need use bluetoothlescanner.startscan() method start scan. below description change logs: to provide users greater data protection, in android 6.0, android removes programmatic access device’s local hardware identifier apps using wi-fi , bluetooth apis. wifiinfo.getmacaddress() , bluetoothadapter.getaddress() methods return constant value of 02:00:00:00:00:00. to access hardware identifiers of nearby external devices via blue

java - How to split an ArrayList<E> into ArrayList<ArrayList<E>>? -

i'm pretty new java , trying create arraylist<arraylist<integer>> arraylist<integer> (splitting 28800 data points pieces of 300). public static arraylist<arraylist<integer>> createlistofarrays(arraylist<integer> list) { arraylist<arraylist<integer>> listofarrays = new arraylist<arraylist<integer>>(); arraylist<integer> temp = new arraylist<integer>(); (int = 0; < list.size(); i++) { int arrayint = list.get(i); temp.add(arrayint); if (temp.size() % 300 == 0) { listofarrays.add(temp); temp.clear(); } } return listofarrays; system.out.println(listofarrays.size()); system.out.println(listofarrays.get(0).size()); } my print statements give me right size of 96 arraylists empty. if remove temp.clear() consist of 28800 integers . i need 96 * 300 different arraylists in arraylist . for (int = 0; <

ruby on rails - Can't get search on a date range based on created_at working -

i trying add ability search records based on from/to date range. class search < activerecord::base has_many :documents # code below sets scopes based on search/input form entries. def search_documents documents = document.all documents = documents.where("subject ?", "%#{subject}%") if subject.present? documents = documents.where("body ?", "%#{text}%") if text.present? documents = documents.joins(:category).where("categories.name ?", "%#{category}%") if category.present? documents = documents.joins(:author).where("authors.name ?", "%#{author}%") if author.present? documents = documents.joins(:reviewer).where("reviewers.name ?", "%#{reviewer}%") if reviewer.present? documents = documents.where("created_at >= ?", "{from_date}") if from_date.present? the first 5 lines work fine. problem last line date. way now, no reco

sonarqube5.1 - SonarQube 5.1 fails execution with message "The project already being analyzed" -

we have had occurrences sonarqube job running hours, appears hung no eta on completion in our ci environment. have used workaround solution of not aborting build job, there seems secondary process executing sonarqube on ci agent itself. have read specifying sonar.forceanalysis=true should resolve issue has been deprecated of version 3.x , there no need use analysis parameter. able proactively address , not have respond after team running sonarqube notifies of issue. there way of specifying timeout process running analysis terminate? if looking killing analysis running in ci environment after time, suggest feature offered ci environment. there no such thing in sonarqube. as side note, should have upcoming 5.2 release of sonarqube. have cut connection database analyzer means error “the project being analyzed” can not occur more. in addition, quite bunch of work done analysis job has been moved server allow run faster.