Posts

Showing posts from September, 2011

date - How to get months in R when my data has attribute 'hours since'? -

i working monthly climate data , want dates data covers in form of yyyy-mm such 2015-01, 2015-02, etc. attribute of dataset says 'hours since 1800-1-1 00:00:00'. data covers period 1948-2015 @ monthly resolution. i tried following both not giving me expect: months<-as.posixlt(time_slp, origin='1800-1-1 00:00:00') months<-as.date(time_slp, origin ="1800-1-1 00:00:00") sample time_slp : time_slp <- c(1569072, 1569816, 1570488, 1571232, 1571952, 1572696, 1573416, 1574160, 1574904, 1575624) you can try: as.posixct("1800-01-01 00:00:00")+as.difftime(time_slp, units="hours") to know month of each date, use months : months(as.posixct("1800-01-01 00:00:00")+as.difftime(time_slp, units="hours")) to have in format asked in comments, try strftime (say x object obtained first line): strftime(x,format="%y-%m")

node.js - NodeJS: How to use for async helper method for async method -

i'm using async library asynchronous programming on nodejs. want make helper method (that use async method), rather put code in same place. here sample code: var solve = function() { async.waterfall([ // long working task. huh function (callback) { settimeout(function() { console.log('hello world!'); callback(); }, 2000); }, function (callback) { authorservice.helperasync(); }, function (callback) { settimeout(function() { console.log('bye bye!'); }, 2000); } ]); }; solve(); in other file, make async function: var helperasync = function() { async.waterfall([ function(callback) { console.log('task 1'); callback(); }, function (callback) { console.log('task 2'); callback(); } ]); } i want result should be: hello w

css - How can apply bootstrap classes like and their respective behavior to only mobile mode using media queries? -

i have table in application use ui breaks when screen width reduces lesser 600px. want apply following bootstrap classes add scroll application : .table-scrollable .table-scrollable-borderless but, don't want scrolls appears in desktop ui. so, decided use media query : <style> @media (max-width: 600px) { } </style> but, since these not own custom designed class instead classes inherited bootstrap. dont know how invoke media queries. and can't change class names either because sure, there jquery generate scrolls based on these class names. please guide. you want add property overflow-y: scroll; to element want have scroll bar. , borderless of course achievable via border: none; . please note, when adding overflow-y: scroll , it's important have set height . hope helps.

.htaccess - Wordpress Multisite development on PHP Built-In Webserver -

i trying set development environment wordpress multisite on local mac. developing using phpstorm, , built-in php webserver. 1 of limitations of built-in webserver is doesn't support apache mod_rewrite, instead uses routing scripts. there's little clear documentation on translating these .htaccess rules. rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] # add trailing slash /wp-admin rewriterule ^wp-admin$ wp-admin/ [r=301,l] rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] rewriterule ^(wp-(content|admin|includes).*) wordpress/$1 [l] rewriterule ^(.*\.php)$ wordpress/$1 [l] rewriterule . index.php [l] is i'm starting from, basic wordpress redirect htaccess multisite wordpress in own directory (/wordpress)... can point me in direction resources on how translate routing script? so managed work (at least using different domains each site). here took: add line near beginning of wp-config.php detect

python - read_table error while reading .idx file -

i'm trying read .idx file 1.89gb in size. if write: indexfile=pd.read_table("c:\edgar zip files\2001\company.idx") i output as: company name form type cik date filed file name 0 033 asset management llc / ... 1 033 asset management llc / ... 2 1 800 contacts inc ... 3 1 800 contacts inc ... 4 1 800 flowers com inc ... where columns merged in single column if do: indexfile=pd.read_table("c:\edgar zip files\2001\company.idx",sep=" ") i error: cparsererror: error tokenizing data. c error: expected 69 fields in line 4, saw 72 i can use: indexfile=pd.read_table("c:\edgar zip files\2001\company.idx",error_bad_lines=false) but remove of data. is there workaround? ps: link sample .idf file sec edgar . download company.idx file. your column entries have spaces in them. use 2 spaces separator. indexfile=pd.read_table("c:\edgar zip files\2001\company.idx",sep="

python - Set up spark using an external virtual machine -

i not huge computer person many others on here, majored in math matlab main computer knowledge. have got involved apache spark through excellent edx course offered berkeley. the method used setting spark provided in great step step guide, involved: downloading oracle vm virtual box ubuntu 32bit vm, through use of vagrant (again i'm not hugely computer-y not 100% sure how worked or is) connect ipython notebook. enabled me have access spark on internet , code in python pyspark, want do. everything going until second lab exercise, became apparent windows laptop has insufficient free memory (just 3 gb , 4 years old) after continually froze , crashed when trying work large datasets. it not possible have vm in vm apparently have spent of today looking alternative ways of setting spark no avail; guides aimed @ more computer knowledge have. my (likely naive) idea rent external machine can interface through windows laptop before virtual machine operates outside of memory of lapt

How to call a C# method in a C# class from Java? -

[dllimport(@"cesmlm.dll", callingconvention = callingconvention.cdecl)] private static extern uint32 ceprngettotpaperremainingusb( int intdev, ref uint32 dwnumcmpaper, ref uint32 dwsyserr); this method in c# class, wanna call in java class. it's possible call ? here few options: http://www.codeproject.com/articles/378826/how-to-wrap-a-csharp-library-for-use-in-java also can use ikvm java/.net interop http://www.codeproject.com/articles/594632/ikvm-net-in-details

javascript - Angular Ben Drucker's credit card script not working -

i trying integrate ben drucker's credit card validation ( https://github.com/bendrucker/angular-credit-cards ) in our angular application. in app.js have following declaration: angular .module('flyvipapp', [ 'nganimate', 'ngcookies', 'ngresource', 'ngroute', 'ngsanitize', 'ngtouch', 'mm.foundation', 'ui.router', 'credit-cards', 'ui.router.statehelper' ]) the following form code: <div id="sidepanelcontent"> <a ui-sref="^" ui-sref-opts="{reload: true}" class="closesidepanel"><img src="images/admin/botao-fechar.png" alt="fechar"></a> <h1>pagamento voo</h1> <form name="ccform"> <div> <p ng-show="flight"> <strong>id:</strong> {{flight.flightid

graphics - TextureRegion cuts texture in a wrong way -

i want have background texture 3 rectangles , want create animation them, - texture but first rectangle cuts in proper way , 2 others cut in dumb way proper way , dumb way #1 , dumb way #2 here code. public class mainmenu implements screen{ texture background_main; textureregion[] background_textures; animation background_animation; spritebatch batch; textureregion current_frame; float statetime; bobdestroyer game; orthographiccamera camera; public mainmenu(bobdestroyer game){ this.game = game; } @override public void show() { camera = new orthographiccamera(); camera.settoortho(true, gdx.graphics.getwidth(), gdx.graphics.getheight()); batch = new spritebatch(); background_main = new texture(gdx.files.internal("main_menu_screen/background.png")); background_textures = new textureregion[3]; for(int = 0; i<3; i++)

ios - How to get all elements returned by a method include those defined from super class? -

i'm writing json <> model serializer. 1 of feature ignore properties model when converting json. i'm letting model implement - (nsarray *)ignoreproperties method tell serializer properties should ignore. needs support inheritance. i'm stuck how combine array elements object , super classes. @protocol serializermapping <nsobject> - (nsarray *)ignoreproperties; @end @interface basemodel : nsobject <serializermapping> @property nsstring *baseproperty; @end @implementation basemodel - (nsarray *)ignoreproperties { return nil; // nothing ignore } @end // --- @interface supermodel : basemodel @property nsstring *property1; @property nsstring *property2; @end @implementation supermodel - (nsarray *)ignoreproperties { return @[@"property1"]; } @end // --- @interface awesomemodel : supermodel @property nsstring *property3; @property nsstring *property4; @end @implementation awesomemodel - (nsarray *)ignoreproperties { return @[@&q

ios - Auto Layout left margin constraint based on percentage of screen width -

i have 4 buttons. want them 13% of screen width left edge , bottom edge. i'm using auto layout , size classes. know can specify number of points in interface builder storyboards won't job done when going device device. need hook constraint through iboutlet , calculate constraint there in code achieve desired result? or possible using interface builder? this special case, can't handled in ib (afaik). these combo boxes don't contain available attributes. do in code: let con = nslayoutconstraint(item: myview, attribute: .left, relatedby: .equal, toitem: fullwidthview, attribute: .width, multiplier: 0.13, constant: 0.0) replace myview button. replace fullwidthview view occupies whole width of device. typically uiviewcontroller.view . and same thing .bottom , .height , fullheightview .

ruby on rails - RSpec Post with a file, params and header field -

i trying test out api using rspec uploading file. api request simple post request file along params , header field. i tried making post request following code: post "media.upload", { client_id: @client.id, token: @client.token, type: @type, name: @name, format: 'json' }, { 'http_proxy_ssl' => 'true' }, :upload => @file but following error: failure/error: post "cm/media.upload", { client_id: @client.id, token: @client.token, type: @type, name: @name, format: 'json' }, argumenterror: wrong number of arguments (4 1..3) the @file variable defined as: @file = fixture_file_upload(rails.root + 'spec/fixtures/images/abc.jpg', 'image/jpeg') so question how post request in rspec file, parameters , headers? move upload param in rest of request params: params = {upload: @file, client_id: @client.id, token: @client.token, type: @type, name: @name, format: 'json'} headers = {&

ios - Pausing AvAudioPlayer from another view controller returns EXC_BAD_ACCESS Swift -

i've page-based application root view controller has button suposed pause avaudioplayer in data view controller. take granted know how root , data view controller work. mine looks this . when i'm pressing button exc_bad_access. when i'm pausing button have on data view controller it's working fine without crash. i've tried: • add pause code in function , call function var dataview = self.storyboard?.instantiateviewcontrollerwithidentifier("dataviewcontroller") as! dataviewcontroller dataview.pause() dataviewcontroller func pause() { player.pause() } • calling function in dataview calls function pauses player • tried call with dataviewcontroller().player.pause() • tried call player.prepareforplay() before player.pause and of them gives me same error. can because rootviewcontroller doesn't have permission edit player in dataviewcontroller? this code: dataviewcontroller().player.pause() creates new instance of da

amazon web services - How to check availble package software versions in AWS SSH? -

i wanted install following packages in ec2 instances via ssh sudo yum install gcc make httpd php-common php cli php-pear php-devel git imagemagick-devel but know, possible list of available versions of each package before install? eg: php:4x php:5x php-pear xv like wise each software packages?

asp.net mvc - c# generic types and repository pattern -

i working on c# mvc application using repository pattern. using unity ioc in order implement repository within mvc application. i have created following generic type goal of minimizing code replication throughout applications. here sample: public abstract class genericrepository<t, c> : idisposable,igenericrepository<t> t : class c : dbcontext, new() public async void addobjectasync<t>(t entity) t : class { try { // validate that there not existing object in database. var x = _context.entry(entity); if (!exists(entity)) { _context.set<t>().add(entity); // add entry if not exist. _context.savechanges(); } else { updateobjectasync(entity); // update entry if did exist. } } catch { throw; } this working great when use tpc or tph strategy, not play t

logging - Apache 2.4, custom module not respecting ErrorLogFormat -

i have custom c module apache 2.4 (on windows, though hope not relevant). within module write out errors , ap_log_perror. well, error messages log file. recently, tried create custom format error log file using errorlogformat directive, e.g.: # timestamp (pid:tid) [level] [module] {client} (errorcode) message errorlogformat "%{u}t (%p:%t) [%l] [%m] {%a} (%e) %m" for standard apache modules, format change works nicely, e.g.: thu jul 16 17:45:28.521107 2015 (1912:1504) [info] [ssl] {127.0.0.1:52505} ((os 10060)a connection attempt failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond. ) ah01991: ssl input filter read failed. thu jul 16 17:45:28.521107 2015 (1912:1504) [debug] [ssl] {127.0.0.1:52505} ah02001: connection closed child 98 standard shutdown (server myhost.meditech.com:443) for custom module, however, format default: [thu jul 16 17:45:28.821350 2015] [my_mod:notic

html5 - Convert Dynamic HTML to PDF -

i using jsp display html , css3. when display html page, have pdf icon, if clicked need convert html page pdf , download it. i have tried using xmlworker, there need send html link through url. saying exception, " runtimeworkerexception: invalid nested tag head found, expected closing tag script. ". cant hard code html. is there easy way click button, html content page can downloaded pdf? new programming couldn't fix issue. went through other question there no clear explanation regarding this. you can use jspdf convert html pdf online, using javascript on client side. the initialisation code simple: // you'll need make image data url // use http://dataurl.net/#dataurlmaker var imgdata = 'data:image/jpeg;base64,/9j/4aaqskzjrgabaqeasabiaad/4ge4sundx1bst0zjteuaaqeaaaeoyxbwbaigaabtbnryukdcifhzwiah2qacabkacwaaaathy3nwqvbqtaaaaabhchbsaaaaaaaaaaaaaaaaaaaaaaaa9tyaaqaaaadtlwfwcgwaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaatkzxnjaaab

xpath - Xml search in parent node -

i have xml: <data> <title>nice day</title> <foo> <bar> <count>5</count> </bar> </foo> </data> at first search specific node xpath e= root.findall('/title/foo/bar/count') then check value of node special condition if int(e.text)>0: if node satisfies me, want value of title node. now i'm looking right xpath syntax it. thanks. fount foo grandchild count has text , take title text of same parent //foo[bar/count/text()]/../title/text()

javascript - Iframe document global -

this first js/html problem have came across in months haven't been able find answer online. if dynamically filling iframe using jquery or plain javascript, (so guess same origin parent document), , fill child iframe script in body uses "document" global - ie "$(document).ready", how can ensure accesses child document opposed parent? if fill dynamic iframe following html: <iframe id='if'><iframe> and added following function in script tag: $(function () { var innerdoc = $($('#if').contents()[0].childnodes[0]); innerdoc.html("<scr" + "ipt>" + "var h1 = document.createelement('h1'); " + "h1.innertext = 'hi!';" + "document.body.appendchild(h1);" + "</scri" + "pt>"); }); the html inserted body of parent document. have determined because 'document' variable in script tag being dynamically i

python - Tweet feature 'created_at' 10 digit number meaning -

i have tweet data file. each has feature 'created_at' in following format: u'created_at': 1369859382 what 10 digit number correspond to? appreciated. that unix timestamp ... http://www.onlineconversion.com/unix_time.htm the example suggested equivalent wed, 29 may 2013 20:29:42 gmt here useful resource mystery date/times formats ... http://www.fmdiff.com/fm/timestamp.html?session=vc8uqio2fsg9op81ohnhbthclmsb21j3

Lua socket HTTP getting connection refused -

i'm trying create function creates issue github repository using lua socket.http , i'm getting connection refused everytime. documentation socket bit unclear , couldn't find more helpful information on why request getting refused every time. tried following: local config = { token = "oauth token github" } local http, ltn12 = require("socket.http"), require("ltn12") local payload = '{"title": "test", "body": "test body", "labels": ["bug"]}' local response, status, headers, line = http.request("https://api.github.com/repos/<username>/<repository>/issues?access_token=" .. config.token, payload) so checked again how , there second form request. i'm trying following: local response = {} local _, status, headers, line = http.request{ url = "https://api.github.com/repos/<username>/<repository>/issues", sink = ltn12

swift - how to set cornerRadius for only bottom-left,bottom-right and top-left corner textview? -

how set corner radius only bottom-left,bottom-right , top-left corner textview? let rectshape = cashapelayer() rectshape.backgroundcolor = uicolor.redcolor().cgcolor rectshape.bounds = messages.frame rectshape.position = messages.center rectshape.path = uibezierpath(roundedrect: messages.bounds, byroundingcorners: .bottomleft | .topright, cornerradii: cgsize(width: 20, height: 20)).cgpath messages.layer.addsublayer(rectshape) this code create 2 rect. dont know why. you need mask layer shown below: for swift 3 : let rectshape = cashapelayer() rectshape.bounds = self.myview.frame rectshape.position = self.myview.center rectshape.path = uibezierpath(roundedrect: self.myview.bounds, byroundingcorners: [.bottomleft , .bottomright , .topleft], cornerradii: cgsize(width: 20, height: 20)).cgpath self.myview.layer.backgroundcolor = uicolor.green.cgcolor //here i'm masking textview's layer rectshape layer self.myvie

javascript - Html2Canvas.js 'getElementsByTagName' error in Chrome or Firefox -

i using html2canvas.js convert html elements images , creating pdf of images print. i have used html2canvas.js version 0.4.1 , 0.5.0 , have no problems in ie, chrome , firefox throw " element.getelementsbytagname not function". any ideas?

c# - How do I get an arbitrary entity stored in the context with Entity Framework? -

i using entity framework. need arbitrary entity context can use reflection @ properties. don't need specific entity, arbitrary 1 do. call should this: entity oldentity = (entity)_context.set(newentity.gettype()). and method should go after last . don't see work (find best bet can't use since don't know id's of of entities). edit: i forgot mention newentity passing in generated codedom class, newentity same entities in context, may have different properties, why have example "old" entity compare properties. clarify this, imagine have stored person entity properties: first name last name then want add new property, let's age. way i'm doing generating new person entity class codedom age additional property. have updated entity class on disk, can create new entity field, sql table isn't updated. you don't need actual instance of class @ properties. you can use typeof(...) typeof(entity).getproperties()

c# - How to set default value instead of null in deserialization -

after deserialization object null, cause exception in deserialization i've avoided problem setting appropriate property in class: [jsonproperty("jerseynumber", nullvaluehandling = nullvaluehandling.ignore)] public int jerseynumber { get; set; } the problem after deserialization, value of int equal 0 because in json null. want set null value empty, how can achieve this? i've tryed with: [defaultvalue("null")] don't working because value integer. set int nullable try following: public int? jerseynumber { get; set; }

Spark 1.4 image for Google Cloud? -

with bdutil, latest version of tarball can find on spark 1.3.1: gs://spark-dist/spark-1.3.1-bin-hadoop2.6.tgz there few new dataframe features in spark 1.4 want use. chance spark 1.4 image available bdutil, or workaround? update: following suggestion angus davis, downloaded , pointed spark-1.4.1-bin-hadoop2.6.tgz, deployment went well; however, run error when calling sqlcontext.parquetfile(). cannot explain why exception possible, googlehadoopfilesystem should subclass of org.apache.hadoop.fs.filesystem. continue investigate on this. caused by: java.lang.classcastexception: com.google.cloud.hadoop.fs.gcs.googlehadoopfilesystem cannot cast org.apache.hadoop.fs.filesystem @ org.apache.hadoop.fs.filesystem.createfilesystem(filesystem.java:2595) @ org.apache.hadoop.fs.filesystem.access$200(filesystem.java:91) @ org.apache.hadoop.fs.filesystem$cache.getinternal(filesystem.java:2630) @ org.apache.hadoop.fs.filesystem$cache.get(filesystem.java:2612) @ org.apache.hadoop.fs.filesy

excel - How to open a file in a Sharepoint site using VBA -

i trying open file file name changes every week. means date part on file name varying. also, file file inside folder. file name changing. using code below throwing error, 'run time 52: bad file name & number'. need help. dim thepath string dim thefile string thepath = "https://ts.company.com/sites/folder1/folder2/folder3/folder4/" thefile = dir(thepath & "manila_shiftrecord_*" & ".xlsx") workbooks.open (thepath & thefile) thanks! if it's 1 file can use approach: dim sharepointfolder string dim coldisks variant dim objwmiservice object dim objdisk variant dim driveletter string 'create fso , network object set objnet = createobject("wscript.network") set fs = createobject("scripting.filesystemobject") 'get used drive-letters set objwmiservice = getobject("winmgmts:\\" & "." & "\root\cimv2") set coldisks = objwmiservic

ruby on rails - Installing mysql gem on rubinius -

i have tried installing mysql gem on fedora using rubinius keeps throwing failed build gem's native extension , should install development tools first. i on fedora 22 , have mysql-devel library installed. should do? you don’t have gcc et al installed yet. “development tools” being referred yum/dnf group. can install slew of build tools following these instructions . we’re on fedora 22, use dnf instead of yum . so, in short: sudo dnf groupinstall 'development tools' 'development libraries'

Why is the search box not working by default in Jquery Datatables? -

i typing in search box in attempt narrow results. when typing screen flashes trying narrow results results not change. <script> $(document).ready(function () { var table = $('#activeprojects').datatable({ "processing": true, "serverside": true, "ajax": { "url": "../api/project/getall/", "datasrc": "" }, "columns": [ { "data": "projectname" }, { "data": "projectnumber" }, { "data": "projectmanager" }, { "data": "projectarchitect" } ] }); }); </script> i list of data server unable search? when using server side data, datatables won't grab data , filter on client, instead rely on server processing , send parts display

javascript - Canonical way to define page objects in Protractor -

we've been using page object pattern quite while. helps organize end-to-end tests , makes tests more readable , clean. as using page objects organize tests protractor documentation page shows us, defining every page object function , use new "instantiate" it: "use strict"; var headerpage = function () { this.logo = element(by.css("div.navbar-header img")); } module.exports = headerpage; usage: "use strict"; var headerpage = require("./../po/header.po.js"); describe("header , feel", function () { var header; beforeeach(function () { browser.get("/#login"); header = new headerpage(); }); it("should show logo", function () { expect(header.logo.isdisplayed()).tobe(true); }); }); but, in protractor: angular testing made easy google testing blog post, i've noticed page object defined object: var angularhomepage = { nameinput :

java - How much more efficient is sending a certain amount of data from server to client vs client to server? -

let's i'm sending large amount of data server client. inner workings behind reading/writing stream? more efficient server read stream, rather write it? in other words, if send same amount of data client server, faster (on server's side) going server client? my hunch it's more efficient server read rather write, i'm having trouble understanding causes happen! edit: let's assume we're working streams in java, using tcp. after connection established, tcp works symmetrically - shouldn't see performance difference swapping host server , host client. that doesn't mean data flow same in both directions - imagine network connection more bandwidth in 1 direction other, such adsl. it's possible router in middle of connection might decide act differently depending on host server. haven't heard of happening, it's theoretically possible - if isp particularly evil, in order discourage people running servers on residential connectio

c - Can you perform dialog navigation on a child window? -

can perform dialog navigation isdialogmessage() on window contains child controls, , window child of tab control, , tab control child of top level window? normally use isdialogmessage() top-level dialog, , long child dialogs have ws_ex_controlparent extended window style set dialog manager recurse them automatically. also it's recommended child dialogs overlapping siblings of tab controls rather children of them (see e.g. raymond chen's comment on this question ).

javascript - How to send data from input datetimepicker.js to jsp and save this data in db -

it means that, enter value input field 07/05/2015 7:19 pm how can save value (using java, jsp, servlet, mysql) means on reload not lose value. or recommend me else you can send request parameter or hidden field. before page submit can store value hidden variable , submit. provide value datepicker in action class/servlet can value string datestring =request.getparameter("datevalue");

java - No WebApplicationContext found: no ContextLoaderListener registered?, but not every time that start the server -

i need solve problem... i'm working spring-mvc 4.1.6.release, spring-security 4.0.0.release i'm having error just... "sometimes" when start server. that's real problem happens sometimes. java.lang.illegalstateexception: no webapplicationcontext found: no contextloaderlistener registered? @ org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:252) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:222) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:123) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:171) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:100) @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogv

ajax - Joomla This XML file does not appear to have any style information associated with it. The document tree is shown below -

i have installed component joomla called mijopolls, work should until vote ajax turned on. above error when voting, weird thing when browsing kunena forum, can make vote , works flawless. different when browsing other sections of joomla site vs browsing kunena forum? also when browsing kunena forum have error: notice: undefined index: id in /home/xxxxx/domains/xxxx.xx/public_html/components/com_content/router.php on line 69 i hide on live site, maybe has mijopolls working when error appear? use clean joomla , kunena install no core files modified, glad if knew notice too. you need define style in mijo module in "module class suffix" section of module. kunena has own template , uses other style definitions. use style definition kunena in mijo module.

javascript - JSEncrypt producing different output for identical message and public key each time -

i've got simple bit of javascript: <html> <script type="text/javascript" src="http://cdn.rawgit.com/travist/jsencrypt/v2.1.0/bin/jsencrypt.js"></script> <script type="text/javascript"> var message = "this message" // create new jsencrypt object rsa encryption var rsaencrypt = new jsencrypt(); var publickey = "-----begin public key-----" + "\nmigfma0gcsqgsib3dqebaquaa4gnadcbiqk" + "bgqcqdxdfoyjpkcaqex4cbvnctbjx\nmzggmo" + "lss2wyrvu1ixr36kpejcrcyhz+anyhnupykgk" + "+heqjtdsniru5dk5ovyyi\ngf2ulogv5tp/ka" + "k49r9vtxldchrazignqjcdequd/vikd/3dvm8" + "nawr/mtg0ncbe\nreqkatw/xxynjh/coqidaq" + "ab\n-----end public key-----" rsaencrypt.setpublickey(publickey); var encryptedmessage = rsaencrypt.encrypt(message); console.log(encryptedmessage) </script> </h

c++ - Multiple definition, not in a header? Why does floor return a double? -

i tried program merge sort function using static arrays , of course have incomprehensible error. so first question when compile program gives me multiple definition error on line 9 of code: #include <cmath> #include "include\sort.h" /* theses fonctions accept arrays of unsigned short int length in unsigned int */ unsigned short int* sortbyfusion(unsigned short int arr[]) { // here !!!!!!!! const unsigned int arrsize = sizeof(arr)/sizeof(unsigned short int); if (arrsize <= 1) {return arr;} /* declarations , initializations of 2 half array */ const unsigned int arrleftsize = static_cast<unsigned int>(floor(arrsize/2)); const unsigned int arrrightsize = static_cast<unsigned int>(arrsize - arrleftsize); unsigned short int arrleft[arrleftsize]; unsigned short int arrright[arrrightsize]; (unsigned int = 0; < arrleftsize; ++) arrleft[i] = arr[i]; (unsigned int = 0; < arrrightsize; ++)

javascript - AJAX ReadyState 4 Status 200 but responseText undefined -

i have html , php file: test.html : var req = new xmlhttprequest(); req.onreadystatechange = function() { if (req.readystate==4 && req.status == 200) { var dat = req.reponsetext; alert("status text: " + req.statustext); alert("response: " + dat); } }; req.open("get", "info.php", true); req.send(); and info.php : <?php echo "test"; ?> accessing info.php shows "test" expected, responsetext ajax request undefined. missing here? typo typo typo var dat = req.reponsetext; ^^^

ios - Xcode: AWS SDK which I added with CocoaPods doesn't work? -

i trying start work aws sdk on ios. did said here aws sdk github cocoapod. pod file looks this: source 'https://github.com/cocoapods/specs.git' platform :ios, "8.0" use_frameworks! pod 'awscore', '~> 2.2' pod 'awssns', '~> 2.2' end but try import aws: #import <awsiossdkv2/awscore.h> i have error in xcode: 'awsiossdkv2/awscore.h' file not found did wrong? in experience, should import headers based on pod name, this: #import <awscore/awscore.h>

laravel - PHP best practice for action based on an object type -

i have php/laravel best practice question. here scenario: have object "type" property in it. type property set integer of kind. depending on "type" integer in object, different actions have happen. what best way process object? trying desperately think of way avoids using whole bunch of if/else statements feels wrong , ugly way approach this. i.e. don't want this: if($obj->type == 1) { //process actions type 1 } else if($obj->type == 2){ //process actions type 2 } would appreciate advice. thanks! thanks @ryan vincent found resource ( https://sourcemaking.com/design_patterns/strategy/php ) , changed strategy design pattern bit. avoiding hard-coded type values check how dynamic class loading done in strategycontext::__construct method. new class instance initiated $type variable name. class names should strings in php way forces types strings not numbers. different original example in article, attached strategycontext

android - Start Google's restore activity, but it shows always in dark theme -

i developing customized setup wizard in android 5.0+. after google login, call google's restore activity following codes, restore activity shows "dark" theme, not "light" other google page. did miss something? intent intent = new intent(); intent.setaction("com.google.android.setupwizard.restore"); bundle options = new bundle(); options.putboolean("useimmersivemode", true); options.putboolean("setupwizard", true); options.putstring("theme", "material_light"); intent.putextras(options); startactivityforresult(intent, restore_code); you can use cyanogenmod's method of adding: options.putstring("scripturi", "android.resource://com.google.android.setupwizard/xml/wizard_script"); it works, activity crashes when going next screen, there's way around it, haven't looked it.

python - Java Utilizing variables in Eclipse after program runs -

so bit new java , eclipse. more used python. using idle in python able run program it's file , and continue use variables. example, if have code written out defining function, in idle can write there. x = foo() print x however, in java seems need put in main method. public static void main(string[] args) this fine if know want function, if running code took day run, , forgot write out put file. in python, can wait finish running , write file in idle. in java need tell write file in main method , re run it. possible set eclipse work idle don't need rerun program if want new things variables calculated? i have never used netbeans, type of thing easier in netbeans? java compiled language, python scripting language. use scala, or jython (or scripting language) behavior want. it's possible use scrapbook page in eclipse, isn't true repl (which same asking for).

opencv3.0 - Can OpenCV do these processing? -

i working on ocr project. need pre-processing similar link below: http://cn.mathworks.com/help/vision/examples/automatically-detect-and-recognize-text-in-natural-images.html the steps are: region detection (mser) edge detection (canny) connected component analysis (for character candidates filtering) i not familiar opencv. wondering if opencv can of these. yes, opencv provides such functionalities. look @ scene text detection , recognition

jquery - Why changing AngularJS variable successfully but having no effect? -

this question has answer here: bind class toggle window scroll event 6 answers i trying make infinite-scrolling table. have: <tr ng-repeat="x in names | limitto:quantity"> <td>{{ x.density }}</td> <td>{{ x.pressure }}</td> <tr> at end of table have load more button. works ok: <button class="btn" ng-click="loadmore()">load more</button> <script> var myapp = angular.module('myapp',[]); myapp.controller('customersctrl', function($scope) { $scope.quantity = 7; $scope.loadmore = function () { $scope.quantity += 7; } $scope.names = <?php echo json_encode($records); ?>; }); </script> while has no effect: window.onscroll = function () { if($(window).scrolltop() + window.innerheight == $(document).height()){