Posts

Showing posts from February, 2012

javascript - Cannot get module.id with ES6 with SystemJS -

i cannot find equivalent of typescript module.id javascript es6 systemjs. possible use commonjs module in es6 ? tried set moduleids: true in babel options it's not working , documentation says not available common modules

java - Method to insert hyperlinks in description field of Icalendar (ics) file -

Image
i used insert hyperlinks in ics file using x-alt-desc field allowed html tags. issue field worked woth ms outlook , had use alternate description field must contain plain text format (\n added new line). i able following output now outlook : google calendar mozilla thunderbird issue links work best in outlook, still clickable/working in google calendar , plain text in thunderbird. there way can making them clickable in thunderbird google calendar??

jquery - No response for success call after form submiting -

i'm making simple contact form send each message don't see response after function success i.e. message mail sent.. errors.. etc. js var submitcontact = $('#submit'), message = $('#msg'); submitcontact.on('click', function(e){ e.preventdefault(); var $this = $(this); $.ajax({ type: "post", url: 'contact.php', datatype: 'json', cache: false, data: $('#contact-form').serialize(), success: function(data) { if(data.info !== 'error'){ $this.parents('form').find('input[type=text],textarea,select').filter(':visible').val(''); message.hide().removeclass('success').removeclass('error').addclass('success').html(data.msg).fadein('slow').delay(5000).fadeout('slow'); } else { message("thank you!"); ...

java - Marshmallow permissions and explanation -

could explain me plaese how should explain user permission i work camera2api , implement such snippet of code ask permishion dinamicly private void opencamera(int width, int height) { setupcameraoutputs(width, height); camerahelper.configuretransform(width, height, textureview, previewsize, getactivity()); cameramanager manager = (cameramanager) getsystemservice(context.camera_service); try { if (!cameraopencloselock.tryacquire(2500, timeunit.milliseconds)) { throw new runtimeexception("time out waiting lock camera opening."); } if (activitycompat.checkselfpermission(this, manifest.permission.camera) != packagemanager.permission_granted) { // should show explanation? if (activitycompat.shouldshowrequestpermissionrationale(this, manifest.permission.camera)) { // show explanation user *asynchronously* -- don't block // thread waiting user...

Android AdMob Native Express into ListView -

Image
i've problem when admob express native ads load first time , refresh banner. code same github google native ads i've put adpter listview control choise: if (position == 0) { // put admob view initialization here }else{ // listview view element } in case see listview become in parts black background: where errors? lot

How do I detect an existing interactive console from inside ansible? -

i want change behaviour of ansible playbook when executed within interactive console opposed non-interactive console (like ci environment) how can inside playbook? you need way determine whether command runs ci or not. if have access command run suggest add variables command, example ansible-playbook -i inv.yml --extra-vars "ci=true" playbook.yml and can refer ci variable inside playbook determine do. if cumbersome best thing rely on environmental variables ci servers set. should consult documentation of ci server whether sets kind of environmental variables, , if yes do. (but not all) set ci variable true . worst case scenario should specify variable manually in configuration of ci server. you should able access environment variables of management host machine using: {{ lookup('env','ci') }} of course these options work have make sure environment variable set on non-interactive shells (which ci should you), , not set on interactiv...

c# - Monitor SQL table for when X has passed -

say have list of subscribers in database table in sql server. have different rollover dates , therefor have column called rolloverdate. at moment have quartz.net task runs every 5 minutes checks if rolloverdate has passed , performs necessary functions. is there better way this? seems pretty inefficient have run task every 5 minutes check this. other way monitor when x has passed in sql server?

java - Jsefa inserts double quotes in csv file -

i have object this: @csvdatatype() public class mycsvdto implements serializable { @csvfield(pos = 1) private string str1; @csvfield(pos = 4) private string str4; @csvfield(pos = 3) private string str3; @csvfield(pos = 2) private string str2; } if 1 of field contains value: "{"792":{"cust":"\n"},"104":{"firmmnemonic":"fswb","houseaccountnum":104,"branchcode":"al","floorbrokernum":"781","cust":"\n"},"264":{"firmmnemonic":"fmst","houseaccountnum":264,"floorbrokernum":"334","cust":"\n"}}" result in csv looks this: "{""792"":{""firmmnemonic"":""aaaa"",""houseaccountnum"":111,""housesuffix"":null,""branchcode...

github - How to search local commit GIT -

can me retrieve commit? cannot find commit anywhere here's do i'm in branch master i move previous commit in branch master(so i'm in branch) type changes commit , push got error because cannot push commit in branch i move branch master now last commit gone any idea retrieve previous commit? i've tried use git log still can't find last commit try git reflog search commit want ref log message.

android - Is Fused Location Provider good choice? -

i developing application want use fused location provider. have doubts, , couple of questions. when gps off , set priority high, mean gps automatically turned on, or not? can set updatelocation fused provider high priority on demand save battery @ least little bit? how can know fused provider using (is gps or network provider)? , finally is fused provider best choice android location? there negative points it? what opinion? in advance. when gps off , set priority high, mean gps automatically turned on, or not? no, not turned on automatically. if use settingsapi, prompt dialog user , gives information gps must turned on. if user accepts it, gps active automatically. check settingsapi how can know fused provider using (is gps or network provider) if use fused provider api settingsapi properly. make adequate required settings current location request. is fused provider best choice android location? there negative points it? in opinion, before f...

javascript - Highcharts: drawDataLabels wrapper function for pie chart not working -

i have written wrapper function drawing data labels of pie chart. in wrapper function, have updated distance attribute of data labels. when give size attribute in user options, distance not work properly. http://jsfiddle.net/8l5dxa6c/1/ (function(h) { h.wrap(h.seriestypes.pie.prototype, 'drawdatalabels', function(drawdatalabels) { this.chart.series[0].options.datalabels.distance = -30; drawdatalabels.apply(this); }); })(highcharts); the distance has updated in wrapper function required in scenario. can reason drawdatalabels fail when size specified in json options?

Where should I place code to be used across components/controllers for an AngularJS app? -

should associated app module? should component or controller? trying achieve common layout across pages within can place or remove other components. here app's structure looks like: -/bower_components -/core -/login --login.component.js --login.module.js --login.template.html -/register --register.component.js --register.module.js --register.template.html -app.css -app.module.js -index.html this might bit subjective answer in components based angular application create component encapsulate other components. i find particularly useful share login information without needing call service in every single component. (and without needing store user data inside rootscope, browser storage or cookies. for example make component parent so: var master = { bindings: {}, controller: mastercontroller, templateurl: 'components/master/master.template.html' }; function mastercontroller(loginservice) { var vm = this; this...

reactjs - How to set up and subsequently cancel multiple watchers in redux-sagas -

just trying head around redux-sagas , running in problem setting 2 watchers in saga , subsequently cancelling them. some background: have json editor component saga handles calls backend api load , save json schema. project based on react boilerplate , structure of application pretty same. here relevant code: export function* loadschemawatcher() { const action = yield take(load_schema) yield call(loadschema, action) } export function* saveschemawatcher() { while (true) { const action = yield take(save_schema) yield call(saveschema, action) } } export function* editordata() { const watcher = yield [ fork(loadschemawatcher), fork(saveschemawatcher) ] yield take(location_change) yield watcher.foreach(task => cancel(task)) } export default [ editordata, ] i assumed yield watcher.foreach(task => cancel(task)) loop on array of tasks aren't being cancelled. your code doesnt work because foreach returns undefined. you...

python - why is the regex function always popping up the Attribute Error? -

i have been writing function in python ip of computer. code given below : def getip(self): self.path = "/root" self.iplist = [] os.chdir(self.path) os.system("ifconfig > ipfinder") try: file = open("ipfinder","r") self.pattern = '(\d{1,3}\.){3}\d{1,3}' while true: line = file.readline() try: ip = re.search(self.pattern, line).group() self.iplist.append(ip) except attributeerror: pass file.close() except eoferror: ip in self.iplist: print ip i know not way ip of machine. problem attributeerror pops every single time. why happening? wh...

Git: How to copy bitbucket master to a local branch? -

i want copy master of bitbucket branch in local machine. master of local machine different code , don't want change reasons. should first checkout in local branch , git pull remote master ? right? you can fetch , checkout remote tracking branch under different name: git remote add bitbucket /url/of/bitbucket/repo git fetch bitbucket git checkout -b anewbranch --track bitbucket/master that way, local master untouched, , have bitbucket master checked out in own local branch.

objective c - iOS Facebook SDK access token -

i experimenting ios app utilize rest api (asp.net mvc web api) , want users able logon/register using either: username , password (default) facebook authentication i have setup ios facebook sdk , users can logon/register using it. when user register facebook, access token should used bind rest api account? akfaccesstoken or fbsdkaccesstoken? haven´t found tutorials ios app , asp.net mvc web api combined. if knows can find 1 lot. if going @ problem wrong please correct me, still trying wrap head around it. i mention in details best practice know. server have facebook app id (special id app given facebook when register new app). send fbsdkaccesstoken server server encrypt fbsdkaccesstoken app id key , return result named 'accesskey'. you save accesskey , use relation server on. this way, no 1 can know userfbid since u encrypted , didnt share facebook app id since should secret. hope helps!

curl - Telegram Bot that takes data from input form and sends it to a telegram group/user -

i want friend. has simple site made html, javascript , jquery. needs integrate site telegram so, if fills form on site, telegram bot should send information in group chat (i know how take chat_id, nothing more telegram bots). so tried send post requests curl bot sendmessage method, seems didnt worked. maybe made mistake command line curl, doesnt show me output when make request. i`ve found sends output in stdout (whatever is...) so have 2 questions: 1: how can make curl show response output in command line? 2: how make request send message myself (in telegram bot manual says should below..) curl -s \ -x post \ https://api.telegram.org/bot<token>/sendmessage \ -d text="a message bot" \ -d chat_id=65535 \ | jq . i assumed need write in cmd tried personal bot token , chat_id didnt work. you can simple request make bot send message. https://api.telegram.org/bot<token>/sendmessage?text=your message here&chat_id=65535 below sample code can...

android - using same code for fragment and activity -

i have activity, want use fragment somewhere else, have rewrite entire class used both? there needs 2 ways it, first way menu items fragments. second way in part of app needs go page same functions , appearance you can write single fragment. , reuse in activity, not other way around. with code below add fragment want container activity. don't forget check savedinstancestate if null in order see if creating or recreating activity. getsupportfragmentmanager() .begintransaction() .add(r.id.fragment_container, yourfragment.newinstance(), yourfragment.tag) .commit();

python - Show fewer pages in Django pagination -

i working on django application , on 1 of pages use pagination. have around 200 pages , if somewhere in middle has links page 1 - 4, displays 4 pages behind page on, 3 after page on , last 4 pages. looking this i shows fewer pages @ time, maybe first 2, last 2 , current page on +/- 2. {% extends 'base.html' %} {% load pagination_tags %} {% load staticfiles %} {% block body_block %} {% autopaginate art 4 %} <div class="container"> {% if item%} {% x in item %} <div class="floated_img"> {% if x.picture %} <img src="{{ x.picture.url }}" name="aboutme" width="140" height="140" class="img-rounded" class="img-responsive"> {% else %} <img src="{% static "images/ge...

php - Difference between get_template_directory_uri() and upload images to wordpress site -

i'm working wordpress , want understand difference between uploading image in media folder on wordpress dashboard in media folder, , use get_template_directory_uri(); retrieve theme directory , display images have stored in image folder so: <img src="<?php echo get_template_directory_uri();?>/img/image.png"> are there of these solution better other? thank you you should thinking in terms of is content / resources static or dynamic? if resource part of theme (ie. static), best use: <img src="<?php echo get_template_directory_uri();?>/img/image.png"> if part of content , can changed wordpress user, use media uploads. alternative use options framework allow user change static resources.

Linux serial port communication using java and RXTX lib -

i create program communicate serial ports in linux, used netbeans ide , , added rxtx jar file , driver. it working fine when run netbeans gives error when try run outside of netbeans. error is: driver not linked while loading drivers. i put rxtx.jar in ext folder of jre , driver in bin folder check ld_library_path environment variable pointing folder in have rxtx native libraries. can tell java use concrete folder library folder adding -djava.library.path=/path/to/my/dll parameter java invocation command line.

Meteor.isServer and Meteor.isClient usage -

i'm trying understand how use isserver / isclient have .jsx file located in imports/ui/components/user/login.jsx inside tried call meteor.isserver, meteor.isclient both values undefined. i'm newbie meteor , can't understand behavior. import meteor 'meteor/meteor'; import react 'react'; import reactdom 'react-dom'; export class login extends react.component { onsubmit(){ //code omitted console.log(meteor.isclient); console.log(meteor.isserver); } render() { return ( <div classname="row"> //code omitted </div> ) } } i don't think meteor default export, think need write import {meteor} 'meteor/meteor' .

com - C# coclass - GetTypeInfoCount returns 0 -

i have c# class implements interface defined in separate external tlb file, imported project through interop. [comvisible(true)] [comdefaultinterface(typeof(iinterfacefromseparatetlb ))] [classinterface(classinterfacetype.autodual)] [guid("4ffbbd0d-6f4b-47d4-b4f9-586f8c108bad")] [idispatchimpl(idispatchimpltype.compatibleimpl)] public class mycoclass : iinterfacefromseparatetlb {} when pass instance of mycoclass c++ function takes idispatch argument , call idispatch::gettypeinfocount, 0. why? calling idispatch::gettypeinfocount forgot check hresult, 0x8002802b (type_e_elementnotfound). put copy of .tlb file beside dll, set "embed interop types" option false, , problem has gone.

SAS: PROC EXPORT adds a "_" in the Excel sheet name but the _ is not there in SAS? -

i have following sas code exports .xls-file. (nb: need old 1997-2003 format). i specify sheet name be: 'pb organization' but when file created sheet name 'pb_organization' an "_" has been added. happening? ps: file contains right columns , rows, sheet name wrong. %let path_org = "\\folder\currentmonth - pb organization"; proc export data=pb_org2 outfile = &path_org dbms=xls replace; sheet = 'pb organization'; run; from sas docs: sheet=sheet-name identifies particular spreadsheet in excel workbook. use sheet= option when want import entire spreadsheet. if export procedure sheet-name contains special characters (such space) sas converts underscore . the space converted underscore. "employee information" becomes "employee_information" see here http://support.sas.com/documentation/cdl/en/acpcref/63184/html/default/viewer.htm#a003103761.htm

composer update in laravel 5.2 -

i using laravel 5.2. , when composer update command on cli. generate following massages nothing install or update generating autoload files illuminate\foundation\composerscripts::postupdate php artisan optimize generating optimized class loader cant update current version or error new laravel this message composer telling package dependencies have defined in project up-to date. you perhaps modify minimum-stability level if want run things on bleeding edge , have set stable . other possible values in order of decreasing stablity rc , beta , alpha , , dev . wholly package dependent, , should keep in mind package maintainers have reason not releasing things stable . caution against doing on may have running in production environment. see composer.json schema documentation more information on minimum-stablity . if have dependencies defined in composer.json believe aren't being pulled in , should be, please update question relevant portions composer...

Accessing devise current_user inside another rails engine -

so here issue. have main application has devise in it,for creating engine. in engine need current_user main app. not sure how that, tried this link no avail. great. if not recommended please explain why. solved it in engine can access main app using 'main_app'. in variable have access current user, assuming have devise. in order access devise current_user have is main_app.scope.env['warden'].user devise stores user inside warden key in session. since uses warden internally authenticate , store details in session. if there alternative solution please let me know.

Android app is creating duplicated shortcut in homescreen -

i run app on emulator (and on phones) , creating 2 shortcuts in homescreen. if delete app, removes both shortcuts. my app have on splash screen go main screen , i'm using android studio. i believe related <intent-filter> each time delete when run app appears again automatic on both <activity> . manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.epicbit.tecnoprolab" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="15" android:targetsdkversion="23" /> <receiver android:name="receiver.networkchangereceiver" > <intent-filter> <action android:name="android.net.conn.connectivity_change" /> </intent-filter> </receiver> ...

chromecast - Cast Entire Android Screen using Cast API -

is there way cast entire android screen chromecast using cast api? not want implement custom receiver, mirror tablet/device screen tv pressing button on app. you need use remotedisplay apis , build local view on phone (which doesn't need visible on phone, can if want to) , use abovementioned apis present on tv. that, don't need use custom receiver, remotedisplay documentation explains too. note shows view (which part of app) on tv screen; cannot programmatically mirror phone's screen on tv outside of own app (and designated view).

asp.net - How to get Current User's Email address and password in C# -

i'm wondering there solution current users email , password outlook c# ? need information send e-mail desktop app log. since have tagged asp-classic, guess trying implement in classic asp. suggest create new aspx page or handler (ashx) in .net. can implement email functionality in class using microsoft.office.interop.outlook . refer- https://msdn.microsoft.com/en-us/library/office/bb644320.aspx?f=255&mspperror=-2147217396 , sending email through outlook 2010 via c# please note- need use existing windows account can send , receive mails.

swift - Programmatic layout : UIStackView alignment doesn't seem to work -

i have created uiviewcontroller uistackview (vertical axis) wrapped in uiscrollview that's pinned edges of root view auto-layout constraints. i have generated number of uibutton s , added arranged subviews of uistackview . i have tried no avail centre align uibuttons in uistackview . i'm not i'm doing wrong. here's code: import uikit class viewcontroller: uiviewcontroller { var scrollview: uiscrollview! var stackview: uistackview! override func viewdidload() { super.viewdidload() view.backgroundcolor = uicolor.whitecolor() scrollview = uiscrollview() scrollview.translatesautoresizingmaskintoconstraints = false view.addsubview(scrollview) view.addconstraints(nslayoutconstraint.constraintswithvisualformat("h:|[scrollview]|", options: .alignallcenterx, metrics: nil, views: ["scrollview": scrollview])) view.addconstraints(nslayoutconstraint.constraintswithvisualformat("v:|[scrollview]|", opti...

regex - In Oracle (PL/SQL), what is the most efficient way of identifying words in a regular expression? -

edit: should have been specific, need within pl/sql, more within functions/procedures within package. i have routine process many (10s of millions) clobs looking words , phrases. routine optimized removing special characters , using space delimiter of choice. has become obvious need include @ least subset of special characters make text more readable, post processing. subset is; ()*+./ i starting rewrite routines. first bit of code able count words, , came with; select regexp_count(regexp_replace('this (a test) of/special 20.5 some+odd characters.','(\(|\)|\*|\+|\. |\/)',' '),'[^ ]+') dual; i have not run benchmarks on suspect inefficient. there better way? i need use regexp_replace, , regexp_substring in code. existing code this; regexp_replace(regexp_substr(temp_text,'[^ ]+',1,ordinal_position),'(\.$|^\(|\)$)','') upper(regexp_substr(term,'[^ ]+',1,current_count)) notice previous code handled "....

dataframe - Interpolate missing values, and conducting cumulative sum based on other columns in R -

i have data frame this: wpt id fuel dist express local 1 s36 12 1 1 0 2 s36 14 2 1 0 inter s36 na na 1 0 inter s36 na na 1 0 3 s36 16 4 1 0 inter s36 na na 0 1 4 s36 18 6 0 1 5 s36 22 7 0 1 6 w09 45 9 1 0 inter w09 na na 1 0 inter w09 na na 1 0 inter w09 na na 1 0 7 w09 48 14 0 1 8 w09 50 15 0 1 (1)i'd interpolate , insert values places nas of fuel , dist column. treat rows "inter" start , end rows of regular numbered "wpt" unit . conduct interpolation. the expected output this: wpt id fuel dist express local 1 s36 12 1 1 0 2 s36 14 2 1 0 inter s36 14.6667 2.67 1 0 inter s36 15.3333 3.33 1 ...

bluetooth - Pairing two HC05 modules using arduino -

i want send integer values 1 arduino (nano) to arduino (mega2560). arduino nano have accelerometer connected continuously give integer values it. want send arduno mega2560. have tried many tutorials cant pair them. guide me pin 34, key pin etc matter. dnt know how used. have 2 hc05 bluetooth modules. having 6 pins, 1 state , en. please guide me through step step how automatically pair them when power on. in final year project please help. for more easy fork need: 1. 2 serial->usb converters 2. 2 modules hc-05. 3. pc/laptop you need configure 1 module master, - slave. , pairing them. purpose better use modules connected pc on usb->serial converter , terminal (teraterm, putty, etc) both modules. good , sufficient guides: https://alselectro.wordpress.com/2014/10/21/bluetooth-hc05-how-to-pair-two-modules/ http://elasticsheep.com/2011/05/serial-bluetooth-module-masterslave-connection/

c++ - VS2015 : The application was unable to start correctly (0xc000007b) -

i wrote code on visual studio 2015 windows 10 pc. application focused on udp communication , use boost libraries. works when move folder of code windows 7 receive error "the application unable start correctly (0xc000007b)". tried in windows 8.1 , after rebuilding libraries works. what noticed when receive error not load .dll in other versions loads. may problem boost? have ever experienced it? 0xc000007b error when try use x64 dlls in x32 application or other way around, copied wrong dlls. rebuild fixed this, prepared new dlls.

php - Weird characters show up -

i trying fetch prices steam market, works well, , returning array, there 1 problem. cs:go items such stattrak items or knives have either star ( ★ or how valve sends " \u2605 ") or trademark logo ( ™ or how valve sends " \u2122 ") my array doesn't see them these characters, convert instead: â stattrak⢠karambit | damascus steel (field-tested) but should be: ★ stattrak™ karambit | damascus steel (field-tested) this how fetch info: $url = "https://steamcommunity.com/market/search/render/?query=&start=0&count=99&&search_descriptions=0&sort_column=price&sort_dir=popular&appid=730&category_730_itemset%5b%5d=any&category_730_proplayer%5b%5d=any&category_730_stickercapsule%5b%5d=any&category_730_tournamentteam%5b%5d=any&category_730_weapon%5b%5d=any"; $html = file_get_contents($url); $html = json_decode($html, true); $html = $html['results_html']; $dom = new domdoc...

javascript - ChartJS click on bar and change it's background color -

i'm using chartjs paint simple bar chart. bar chart clickable , notice if user clicks on bar. i'd change background of bar has been clicked indicate bar actively selected. is possible? thx edit: i've added small example. https://jsfiddle.net/10n39clz/1/ clicked element collected using: this.getelementatevent(e) if spend time playing console , element, see if log element, have array 1 object (the said element). this object has several children, such _index (what used in fiddle). should start editing element background. if go deep inside _chart child, can edit bar want. i updated fiddle see result : here is . note that effect disappear if mouseleave out of element.

optimization - Julia uses only 20-30% of my CPU. What should I do? -

i running program numeric ode integration in julia. running windows 10 (64bit), intel core i7-4710mq @ 2.50ghz (8 logical processors). i noticed when code running on julia, max 30% of cpu in usage. going parallelazation documentation, started julia using: c:\users\*****\appdata\local\julia-0.4.5\bin\julia.exe -p 8 , expected see improvements. did not see them however. therefore question following: there special way have write code in order use cpu more efficiently? maybe limitation posed operating system (windows 10)? i submit code in julia console command: include("c:\\users\\****\\appdata\\local\\julia-0.4.5\\13. fast filesaving format.jl") . within code use additional packages with: using ode; using pyplot; using jld . i measure cpu usage windows' "task manager". the -p 8 option julia starts 8 worker processes, , disables multithreading in libraries blas , fftw workers don't oversubscribe physical threads on system – since kills...

internet explorer 9 - Angular RC2 and IE 9 -

when testing angular 2 app in browserstack ie 9 (rc 2 currently) noticed app throws "access denied" error. on local working fine , why: if change internet options - local intranet medium-low or low teh app loads fine. if change medium or higher , error. need support ie 9. ideas appreciated . here index file : <!doctype html> <html class="no-feature.html"> <noscript> <meta http-equiv="refresh" content="0;url=no-feature.html"> </noscript> <head> <base href="/"> <title>poc</title> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="description" content="angular 2 starter"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href='//fonts.googleapis.com/css?family=open+sans:300,400,600...

java - Strategy for accessing data in multi-tenant environment with Spring and Hibernate -

i working in multi-tenant environment data can accessed 10 different datasources (and entitymanagers) webapplication (rest) frontend. the entitymanager used depending on url parameter in rest api, ex. api/orders/ 1 /1000003. i need use entitymanager "1" fetch data. @ moment using method in repository layer call setdistrict(1), before creating hibernate session , creating query via hibernate criteria. all working fine, worried fact method need synchronized avoid getting data wrong entitymanager. when synchronize repository method worried performance horrible.. what strategy implementing multi-tenant access performance , correct data returned under heavy load well? thanks advice. the sessionfactory of hibernate allows use tenancy behavior : schema correlates separate schema approach. error attempt open session without tenant identifier using strategy. additionally, org.hibernate.service.jdbc.connections.spi.multitenantconnectionprovider ...

symfony - Wrong choices in my choices list -

with symfony 2.7, have 2 differents forms in webpage : form 1 : public function buildform(formbuilderinterface $builder, array $options) { /* $choices = array( 0 => (entity "personne"), 1 => b (entity "personne") ) * */ $builder ->add('personne', 'entity', array( 'class' => 'logicielbundle:personne', 'choices' => $choices, 'label' => 'banque' )) ; } public function getname() { return 'logiciel_remise_selection_form'; } form 2 public function buildform(formbuilderinterface $builder, array $options) { /* $choices = array( 3 => c (entity "personne"), 4 => d (entity "personne") ) * */ $builder ->add('personne', 'entity', array( 'clas...

How to create translation ready theme WordPress? -

Image
i in search of translating theme see themes in content shown _e('some text', 'textdomain'); tried poedit software failed. totally unable achieve while have been through these steps :( https://www.smashingmagazine.com/2011/12/internationalizing-localizing-wordpress-theme/ http://code.tutsplus.com/tutorials/translating-your-theme--wp-25014 still failed though provided info, can 1 guide in full detail or easy way achieve ? in advance here how can in poedit software ? open poedit tool , go file > new catalog provide desired info (project related info name etc) then here info path in project catalog: and here keywords (keywords want translate). when done ok save project here note now: note: have created languages folder inside theme directory. means above info valid if placing .po file inside languages folder. so, once click on ok button, save file theme name , ready go. note2: in above example used theme example purposes can use ev...

sql - Execute dynamic query result using stored procedure -

the below query return 60 rows, how can execute statements using stored procedure in single go. select 'update temp1 set ' + column_name + '= 0' + ' '+column_name+ ' null' information_schema.columns table_name = 'temp1' , data_type = 'float' , column_name not in('sales','net_margin'); here 1 way it: declare @sql nvarchar(max) = '' select @sql = @sql + 'update temp1 set ' + column_name + '= 0' + ' '+column_name+ ' null; ' information_schema.columns table_name = 'temp1' , data_type = 'float' , column_name not in('sales','net_margin'); print @sql -- remark row once check sql , unremark next 1 execute --exec(@sql)

javascript - Pass ID into Bootstrap Modal? -

how pass id <button> bootstrap modal. can use id information ajax display in modal. for example: button: <button id="123" type="button" class="btn btn-sm" data-toggle="modal" data-target="#testing">edit</button> should use shown.bs.modal this? $("#testing").on('shown.bs.modal', function () { // how id? id="??" //ajax }); you can use event object passed show.bs.modal handler. $('#testing').on('show.bs.modal', function (event) { var id = $(event.relatedtarget).attr('id'); }); event.relatedtarget refers button has triggered modal open event. bootstrap documentation

javascript - Generate Base64 String with local url of image without input type file -

i trying generate base64 string of local url of image. searched lot didn't got answer. found many example convert base64 string http url of image have local url of image. tried create file object not working. here example tried: convertfiletodataurlviafilereader(url){ var file = new file([""],url, {type: "image/jpeg"}); let reader = new filereader(); reader.onload = (event) => { var base64 = event.target.result; return base64; }; reader.readasdataurl(file); } here url absolute path of image : file:\\c:\users\abc\pictures\butterfly.jpg example not generating base64 image ie returning blank string : output data:/

jquery - Drupal AJAX won't work on Google Chrome on Android smartphones -

on desktops works fine, on smartphones - except google chrome on android devices. when use chrome's device inspector shows ajax request takes long respond, when it's done returns incomplete results. what reason? how fix it? chrome timing out before site returns results, therefore solution basically: "get there faster". make sure site's caching enabled , working properly , , have sufficient server resources deliver content in reasonable amount of time. if request particularly long or complex try provide in smaller pieces across multiple requests can complete more (note may cause slower overall experience avoid timeout). keep in mind mobile devices operate on slower connections , need take account when dealing speed issues.

How do I create a view in SQL Server 2014 to see data from cross referenced tables where some data is missing? -

i trying generate report normalized database tables a, a_xref_b, , b. create table (a_rid int primary key, a1 varchar(20), ); create table b (b_rid int primary key, b1 varchar(20), b2 varchar(20)); create table a_xref_b (a_rid int, b_rid int,xref_type int constraint fk_a foreign key (a_rid) references (a_rid), constraint fk_b foreign key (b_rid) references b (b_rid)); insert values (1,'john'), (2,'sue') insert b values (1,'atlanta','ga'), (2,'macon','ga'), (3,'opp','al') insert a_xref_b values (1,1,1), (1,2,2), (2,3,1) table , b cross-referenced , have cross reference has type, defines data in b represents. scenario - john provided main city , alternate. sue provided main city. i trying write view load page has name, main city, , alternate. name b_rid_t1 city_t1 st_1 b_rid_2 city_t2 st_t2 john 1 atlanta ga 2 macon ga sue 3 opp al null null nu...

How to use Internal Storage of Android in Xamarin? -

i want able use android's internal storage. found code snippets like: string path = application.context.filesdir.path; var filepath = path.combine(path, "test.txt"); system.io.file.writealltext(filepath, "hello world"); but not figure out application in here. is there solution or different perspective? :) use this: string path = system.environment.getfolderpath(system.environment.specialfolder.personal); string filename = system.io.path.combine(path, "testfile.txt"); // write using (var streamwriter = new streamwriter(filename, true)) { streamwriter.writeline(datetime.utcnow); } // read using (var streamreader = new streamreader(filename)) { string content = streamreader.readtoend(); system.diagnostics.debug.writeline(content); }

objective c - How can I enable access of NSURLCredentials when an iOS Device is locked? -

i using swagger generated swift client uses nsurlcredentials authenticate server. using persistence type .permanent app communicates server in background , works fine, except when lock phone (i see 401 errors in log). believe nsurlcredential not able access keychain when phone locked. came across posts talk enabling keychain access using ksecattraccessibleafterfirstunlock . haven't been able figure out how nsurlcredential . know if , how can configured? yes, that's happening, in likelihood. have couple of options: delete underlying keychain item , recreate it, specifying should accessible when device unlocked. don't need use nsurlcredential @ approach. create internet password item using keychain services apis , credential store should pick automatically. keep credential data in memory, , implement urlsession:task:didreceivechallenge:completionhandler: delegate method in session delegate (or equivalent method nsurlconnection if you're using api)...

c# - How to find namespace of class by its name using reflection in .net core? -

i have list of string classes names. need create instances of them using activator, of them can in diffrent namespaces. classes can move namespace in future can't hardcode it. if know you'll never have multiple types same name residing in different namespaces, can iterate on types in assembly , filter on type name. example, works: var typenames = new[] { "string", "object", "int32" }; var types = typeof(object).gettypeinfo().assembly .gettypes() .where(type => typenames.contains(type.name)) .toarray(); // type[] containing system.string, system.object , system.int32 this won't break if have multiple types same name, you'll of them in list.

ansible - How to disable gathering facts for subplays not included within given tag -

several of playbooks have sub-plays structure this: - hosts: sites user: root tags: - configuration tasks: (...) - hosts: sites user: root tags: - db tasks: (...) - hosts: sites user: "{{ site_vars.user }}" tags: - app tasks: (...) in ansible 1.x both admins , developers able use such playbook. admins run tags (root , user access), while developers had access last tag tasks @ user access level. when developers run playbook app tag, gathering facts skipped first 2 tags. however, in ansible 2.1, not being skipped, causes failure users without root access. is there mechanism or easy modification fix behaviour? there new approach should applied such cases now? there easy mod – turn off facts gathering , call setup explicitly: - hosts: sites user: root tags: - configuration gather_facts: no tasks: - setup: (...)

ms access - Form set to be used for data entry attempting to create duplicate records causing error -

i have form set used data entry not working. when form opens blank when entered in field primary key field (visible not editable on form) sets value in use. rest of fields on main form remain blank have subforms fill values corresponding primary key. source of form single table linked database backend. table has no missing records. exact error when try close form is: "the changes requested table not successful because create duplicate values in index, primary key, or relationship. change data in field or fields contain duplicate data, remove index, or redefine index permit duplicate entries , try again." the same error occurring on form used updating records. error appears anytime entered field on subform. any ideas appreciated! thanks as understand, access inserts automatically new value autonumber field, , value exists. if so, run compact & repair, set autonumber next value max in field + 1 access generates new value autonumber fields using internal...

xamarin - Admob lag only on Android -

i having issue admob causing high amount of lag when ad loading. have admob setup both android , ios, , problem occurs on android. running on older iphones, there little no lag, whereas high end android phones (nexus 6p lg g4) having lag. use xamarin studio , monogame's framework build apps. i've tried threading ad separately. i've searched on answer, , know found android heap limit/size? problem? game lags when it's not recieving ad, believe ad's animation may problem. thank in advance help! here code: protected override void oncreate(bundle bundle) { base.oncreate(bundle); // create our opengl view, , display // !important! var g = new game1(); //setcontentview((view)g.services.getservice(typeof(view))); //createads((view)g.services.getservice(typeof(view))); createads(g.services.getservice<view>()); // !important! g.run(); } private void createads...

html - Make height of input and div equal to their parent -

Image
i've got following code: .wrapper { display: flex; height: 25px; } .myinput { width: 50px; height: 100%; border: 1px solid grey; border-right: none; } .myinputaddon { width: 25px; height: 100%; background-color: green; border: 1px solid green; } <div class="wrapper"> <input class="myinput"> <div class="myinputaddon" type="number"></div> </div> i thought, when give hardcoded height wrapper div (in example 25px) , height: 100%; child-elements, flex correctly , have same height. but in snippet, input higher div. if remove height wrapper div , give input height 23px , child-div 25px, works. set little bit dynamically. it should this: how can this? thanks , cheers. the problem default padding of input element can add box-sizing: border-box , keep padding inside height of element. .wrapper { display: flex; height: 25px; }...

javascript - How can I fix "ReferenceError: $ is not defined" when using jQuery with mocha-jsdom? -

i'm setting es6 unit tests in project , having trouble making them work libraries. thought i'd use jquery test try , make work. without libraries, tests work. note jquery imported main.js file available throughout project. my js file looks this: class test { constructor(options) { this.init(); } init() { $('.test-div').addclass('test'); } sayhello() { return 'hello world!'; } } export default test; and test looks this: import jsdom 'mocha-jsdom'; import chai 'chai'; import test './test'; chai.should(); describe('frequency', () => { var $; jsdom(); before(() => { $ = require('jquery'); }) it('should output hello world', () => { const test = new test(); test.sayhello().should.equal('hello world!'); }); }); if remove init() function, test works. however, before function doesn't seem import jquery test. error rece...

Android Permissions Error with FileChooserDialog with the file type picture -

today have problem. have created filechooserdialog nd when select file type picture/image, gives me error. stack trace: 07-11 16:18:43.851 7522-7522/damasoft.manumikychat e/androidruntime: fatal exception: main 07-11 16:18:43.851 7522-7522/damasoft.manumikychat e/androidruntime: process: damasoft.manumikychat, pid: 7522 07-11 16:18:43.851 7522-7522/damasoft.manumikychat e/androidruntime: java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=1234, result=-1, data=intent { dat=content://com.android.providers.media.documents/document/image:1404 flg=0x1 virtualscreenparam=params{mdisplayid=-1, null, mflags=0x00000000)} }} activity {damasoft.manumikychat/damasoft.manumikychat.page1}: java.lang.securityexception: permission denial: reading com.android.providers.media.mediaprovider uri content://media/external/images/media pid=7522, uid=10134 requires android.permission.read_external_storage, or granturipermission() 07-11 16:18:43.851 7522-7522/damasoft.manu...