Posts

Showing posts from July, 2011

git - Splitting a repository with the possibility to later pull changes -

i have repository in have boilerplate code new projects. have 2 projects 2 different clients. projects have resemblances. ideally if add new feature project x think useful other project want add non-specific code boilerplate , pull repo's of individual projects. possible? don't want work branches in same repository since both projects installed on servers of clients capistrano (so can pull changes when doing deploy). , don't want client x able see code of other client. you use built-in subtrees (or criticized alternative, built-in, called submodules ). and take @ git-subrepo project. all options allow have nested repositories. in case, boilerplate repository nested inside clients' repositories. allow them pull boilerplate repository without needing share core code each other.

html - Center horizontall images dinamically with Bootstrap -

i have mysqli_fetch_assoc return me images. need put of these images centered horizontally. try use center-block on of this, center 1 , others images goes down. for example: if mysql give me 2 images: <body> <div class="col-xs-12"> <img src="http://osolephp.com.es/grafa/imagenes/imagenesropa/cocinas_6.png?30" class="center-block"> <img src="http://osolephp.com.es/grafa/imagenes/imagenesropa/cocinas_6.png?30" class="center-block"> </div> </body> https://jsfiddle.net/ff4rj8zs/ if mysql give me 3 images: <body> <div class="col-xs-12"> <img src="http://osolephp.com.es/grafa/imagenes/imagenesropa/cocinas_6.png?30" class="center-block"> <img src="http://osolephp.com.es/grafa/imagenes/imagenesropa/cocinas_6.png?30" class="center-block"> <img src="http://osolephp.com.es/grafa/imagenes/imagenesropa/cocinas_6.

writing .txt to .csv excel columns in Python -

i have rather large text file multiple columns must convert 15 column .csv file read in excel. logic parsing fields need written out below, having trouble writing .csv. columns = [ 'transactn_nbr', 'record_nbr', 'sequence_or_pic_nbr', 'cr_db', 'rt_nbr', 'account_nbr', 'rsn_cod', 'item_amount', 'item_serial', 'chn_ind', 'reason_descr', 'seq2', 'archive_date', 'archive_time', 'on_us_ind' ] line in in_file: values = line.split() if 'print date:' in line: dtevalue = line.split(a,1)[-1].split(b)[0] lines.append(dtevalue) elif 'print time:' in line: timevalue = line.split(c,1)[-1].split(b)[0] lines.append(timevalue) elif (len(values) >= 4 , values[3] == 'c' , len(values[2]) >= 2 , values[2][:2] == '41')

qt - why QOpenGLFunctions_2_0::initializeOpenGLFunctions is so slow on Mac 10.10? -

i need create hundreds of objects call qopenglfunctions_2_0::initializeopenglfunctions() . found initializeopenglfunctions() slow when built qt app on mac 10.10. details: to reproduce issue, built qt opengl example on both mac 10.10 , mac 10.11. , found 1 built on mac 10.10 40 times slower 1 10.11. no matter ran on 10.10 mac or 10.11 mac. to measure time, printed timestamps in openglwindow.cpp qdebug() << qdatetime::currentmsecssinceepoch() << ":" << __line__; initializeopenglfunctions(); qdebug() << qdatetime::currentmsecssinceepoch() << ":" << __line__; initialize(); and outputs are: // built on mac 10.11 1503009550512 : 88 1503009550514 : 90 // built on mac 10.10 (40 times slower) 1503009508921 : 88 1503009509007 : 90 more details of build environments: qt 5.6.2 macos 10.11.6 apple llvm version 7.3.0 (clang-703.0.31) target: x86_64-apple-darwin15.6.0 thread model: posix mac 10.10. apple l

Java Array for random numbers (within a certain range) then a loop to find a specific number in the array -

need figure out how declare array that's attached random number generator generates within given parameters. method find specific number in array. i've had issues number search method not being able investigate array elements. please when you've got time. package arraypackage; import java.util.arrays; import java.util.random; public class bruteforce { //declare integer array 10 numbers. int[] array = new int[10]; random randomint = new random(); //random number generator public void shuffle() { //int prevint=0; for(int = 0; < array.length; i++) //for each integer in array pick random integer , place in array { int temp = 1 + randomint.nextint(array.length); for(int j = i; j < array.length; j++) { if(temp != array[j] && temp!= array[i]) { array[i] = temp; } } } } public void displayarray() { system.out.println(arrays.tostring(array)); } the exact specific h

Django admin template display -

my django admin pages displaying differently on local , on hosting. 1 on local has better display. both running django 1.11.4. have caused this? image of django admin better display on local environment image of django admin different display on hosting

javascript - Local notification every hour with Ionic Framework not working? -

i trying send local notification every hour ionic framework... asked permissions sent notification never got 1 on ios device. var onehourlater = new date(); onehourlater.sethours(onehourlater.gethours() + 1) var notification = { id: 1, title: 'reminder', text: 'reminding thing', every: 'hour', at: onehourlater }; localnotifications.schedule(notification); if not ask there way not send 1 after time not annoying , start them again @ time? thanks! for setting local notification @ every 1 hour can achieved using this plugin follows: localnotifications.schedule({ id: 1, title:'reminder', text: "reminder thing", firstat: after_1_hour, every: "hour" // "minute", "hour", "week", "month", "year" }); for after_1_hour can try following: var today = new date(); today.sethours(1); today.setminutes(0); today.setseconds(0); var after_1_hour =

c# - Why GridView.SelectRow is not working in Devexpress? -

i using devexpress gridcontrol. when try add new row or select row gridcontrol, it's not working. gridcontrolmultifiltervalues.addnewrow(); it throws error message below grid control not contain definition addnewrow , no extension method addnewrow note : tried selectrow() method also. not working update filtervalues column name of gridcontrol. have created column run designer. (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).addnewrow(); int newrowhandle = (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).focusedrowhandle; (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).setrowcellvalue(newrowhandle, "filtervalues", "3rd party %"); (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).updatecurrentrow(); (gridcontrolmultifiltervalues.mainview devexpress.xtragrid.views.grid.gridview).refreshdata(); your error mes

javascript - vue 2.3 AJAX data binding not updating -

after successful ajax call data rendered on page not updating. remaining empty / null. it seems missing how connect data returned front end variable , dynamically / live rendered html elements. here relevant code snippets context. clear missing / incorrect? javascript page = new vue({ el: "#container", data: { option_id: null, option_name: null }, created:function() { $.ajax({ type: 'post', contenttype: 'application/json', datatype: 'json', url: 'ajax_methods/get_option', success: function (ajax_data) { self = this; self.option_id = ajax_data.option_id; self.option_name = ajax_data.option_name; }, error: function (e) { console.log(e) } }) } }) html <script type="text/javascript" src="https://unpkg.com/vue@2.3.3"></script> <div id="container"> <p>{{ opti

r - Using the ks.test function to poisson distribution -

good night people. have question using ks.test function. it giving different results when use ks.test specifying probability distribution: ks.test (sample $ x, "ppois", lambda = mean (sample $ x)) and comparing sample of interest sample generated rpois: ks.test (sample $ x, rpois (length (sample $ x), mean (sample $ x))) could me in deadlock, please?

html - How to install beautiful soup 4 with python 2.7 on windows -

i have windows vista python 2.7. install beautifulsoup 4 apparently can't install beautiful soup copying file site-packages directory. have install pip , run commands command prompt. guide me through step step. noob make simple. in advance you don't need pip installing beautiful soup - can download , run python setup.py install directory have unzipped beautifulsoup in (assuming have added python system path - if haven't , don't want can run c:\path\to\python27\python "c:\path\to\beautifulsoup\setup.py" install ) however, should install pip - see how install pip on windows how best (via @martijnpieters comment)

Best way to implement messages into Firebase database? -

i have app uses database. has node users store users info, node usernames can grab uid given username (to query users in app), , "familys" node contains shared data. i want able "leave" messages other users, should create whole new node store messages? should store messages under uid of user? thanks. examples of nosql firebase database structures simple chat apps, etc appreciated.

vb.net - Failure to Execute UPDATE Query in ASP.net using VB -

i have been searching in several forums including 1 trouble facing. currently developing website using visual studio 2017 , database runs ms access 2007. problem facing perhaps not error, because not show error messages, although have put try , catch on codes. so trying execute update query table have in access fails update. purpose update table called 'datadirikaryawan'. prior updating, select data per 'nip' (id primary key) , display on web form calling function 'isi' on page_load. users able edit data based on preexisting data. protected sub page_load(byval sender object, byval e system.eventargs) handles me.load session("editval") = "wamb17001" isi() end sub protected sub isi() dim dr oledb.oledbdatareader dim nip string = session("editval") try using command new oledb.oledbcommand("select * datadirikaryawan nip='" & nip & "'", mdl_koneksi.connect

ios - View Transition where view has constraints -

i creating custom view transition view controller being presented swings down, using uidynamicanimator. animation works in swinging entire view down, except when move toview off screen in preparation swinging, subviews move due position constraints, altering view. to avoid this, either make copy of entire view controller use or stop subviews autolayouting? so issue 1 of constraints top layout guide, meaning when moved vc, moved views within. fixed making constraint based off of superview, , works perfectly.

ios - Move and Scale UIImageView inside UIView -

Image
i have uiimageview , uiimageview.contentmode = .scaleaspectfit . uiimageview subview of uiview . want able move , scale uiimageview inside uiview , have no success far. i tried overriding touchesmoved drag uiimageview around don't want part of image seen outside of uiview . try select clip bounds not showing component outside of view select uiview -> check mark clip bound

junit - How to mock a class and its inner static class using Powermock -

i have class : public class someclass { private string somefield; public someclass(string field) { somefield = field; } public string geturl() { return "http://" + somefield; } public static class builder { private string uri; public builder(string url) { this.uri = url; } public someclass build() { return new someclass(uri); } } } the above class being called class as: class mainclass { private someclass someclass; public boolean isurlavailable() { someclass = new someclass.builder("myuri").build(); string url = someclass.geturl(); if (url != null && url.length() > 10) { return true; } return false; } } my requirement test mainclass, need mock someclass , someclass.builder class. tried mock 2 classes not achieve requirement. the co

python - ValueError In Pandas -

i have data frame 15 columns suppose out of want 6. performing aggregate , group throwing error. def my_compute_function(my_input): df = pd.dataframe(my_input) df2 = df[(df['d'] == "validated")] df2[['a','e','f']] = df2[['a','e','f']].apply(pd.to_numeric) df3=df2[['a','b','c','d','e','f']].groupby(['b','c','d']).agg({'a': 'max','e': 'max','f': 'max'}).reset_index() return df3 so want 6 columns a,b,c,d,e,f. when adding line df2[['a','e','f']]=df2[['a','e','f']].apply(pd.to_numeric) it throwing error valueerror: can not infer schema empty dataset . for me working perfectly, .copy necessary: df = pd.dataframe({ 'd':['validated','validated','a'], 'e':[&#

applescript - Locate a file anywhere on the hard drive and transfer it to a different folder -

i'm trying create app transfer files name different folder. far, have following: tell application "finder" move (every item of (get path home folder) name "extended image name.jpg") ((get path home folder) & "pictures" string) end tell while doesn't return errors, doesn't want either. aware searches home folder, if there way broader search of whole drive without having enter username, great (i want able run on more computers 1 without them having edit script.) -thanks the code considers files in home folder not in subfolders, consider subfolders have add entire contents tell application "finder" move (every item of entire contents of home name "extended image name.jpg") folder "pictures" of home end tell but aware entire contents extremely slow. shell command find or spotlight search mdfind faster example set homefolder posix path of (path home folder) set picturesfolder posix pa

java - com.google.gson.JsonSyntaxException:Expected STRING but was BEGIN_ARRAY -

kindly me subnodes list inside bom attributes json file [ { "subconfigid":"bac", "totalprice":"634.00", "bom":{ "ucid":"ucid", "type":"rootnode", "attributes":{ "visible":true, "price_status":"success" }, "subnodes":[ { "description":"enterprise shock rack", "ucid":"ucid" }, { "description":"svc", "ucid":"ucid" } ] }, "breakdown":{ "sv":550.0, "hw":6084.0 }, "currency":"usd" } ] gsonnodes.java import java.io.filereader; import java.io.ioexception; import java.util.iterator; import com.google.gson.gson; import com.google.gson.jsonarray; import

html - Div overlap of another div -

Image
i have been trying solve problem have on website building. website displays correctly on desktop browser when normal size, when make browser window small or view site on mobile phone, have layer overlaps footer div on page. please @ image of problem: the layer div overlaps footer has class of logodiv , here css code it: .logodiv{ text-align: center; top: 50%; transform: translatey(-50%); font-family: 'quicksand', sans-serif; font-size: 20px; display: block; } the heading has id name of logoheadline , has following css #logoheadline{ font-family: 'anton', sans-serif; font-size: 58px; position: relative; } lastly footer has class name of footerz , has following css: .footerz{ background-color: #323232; min-height: 200px; color: white; font-family: 'quicksand', sans-serif; } the intro-p div has following css: .intro-p{ font-family: 'quicksand', sans-serif; font-size:

Ansible collectd configuration CentOS -

i trying configure collectd on centos using ansible: i have task: - name: start service new conf systemd: name: collectd enabled: yes daemon_reload: yes state: started that works after run: - name: start service new conf systemd: name: collectd enabled: no daemon_reload: no state: stopped then cannot restart service anymore has happened on 4 different virtual machines. next time get: failed! => {"changed": false, "failed": true, "msg": "unable start service collectd: job collectd.service failed because control process exited error code. see \"systemctl status collectd.service\" , \"journalctl -xe\" details.\n"} the systemd records say: redirecting /bin/systemctl status collectd.service ● collectd.service - collectd statistics daemon loaded: loaded (/usr/lib/systemd/system/collectd.service; enabled; vendor preset: disabled) active: failed (result: start-limit) s

arrays - How can i iterate the below Object Value in android -

how can loop following value showing below e/value: {date=29-07-2017, reciept=rc1, amount=11800} 08-18 12:19:07.568 30246-30246/com.bitblue.dextronewproject e/value: {heading={date=29-07-2017, reciept=rc1, amount=11800}, details=[{updated_at=2017-06-30 14:08:30, is_cheq_msg_send=0, discount=0, bank_name=, date=2017-06-30, cheque_date=0000-00-00, late_fee=0, cheque_num=0, bal=0, fee_type=bus fee, year=2017, cheq_msg=, pay_mode=cash, amount=100, gr_num=1355, unique_id=75, lflag=yes, reciept=rc1, created_at=2017-06-30 14:08:30, reason=, is_active=1, month=aug}, {updated_at=2017-07-29 12:20:52, is_cheq_msg_send=0, discount=0, bank_name=, date=2017-07-29, cheque_date=0000-00-00, late_fee=0, cheque_num=0, bal=0, fee_type=monthly fee, year=2017, cheq_msg=, pay_mode=cash, amount=1000, gr_num=1355, unique_id=65, lflag=no, reciept=rc1, created_at=2017-07-29 12:20:52, reason=, is_active=1, month=aug}, {updated_at=2017-07-29 12:20:52, is_cheq_msg_send=0, discount=0, bank_name=, date=2

swift - UITableViewAutomaticDimension and its Height -

i'm using uitableviewautomaticdimension in tableview , working fine, when table loaded, need cell's row size. of table. possible ? thanks in advance. make viewcontroller conform uitableviewdelegate , set table view's delegate class, use method: func tableview(_ tableview: uitableview, willdisplay cell: uitableviewcell, forrowat indexpath: indexpath) { let frame = cell.frame [...] }

pyjamas - Run python script on button click -

i need run python script python gui(pyjamas).when ever press button python script on specific path should run. on this??? below code, hello.py display button when click button test.py should executed. when see in wireshark no packet sent. idea solve hello.py import pyjd # dummy in pyjs. pyjamas.ui.rootpanel import rootpanel pyjamas.ui.button import button pyjamas.ui.html import html pyjamas.ui.label import label pyjamas import window pyjamas.ui.html import html pyjamas.ui.button import button def greet(): #fred.settext("no, click me!") '''mycode = 'print "hello world"' execfile(printdummy.py) window.alert("hello, sam!")''' #subprocess.call("test.py", shell=true) #execfile(test.py) test.sendpacket() if __name__ == '__main__': pyjd.setup("public/hello.html?fred=foo#me") b = button("click me", greet, stylename='teststyle') rootpan

sql server - I have created 3 tables which contains parent,child,marks -

Image
in parent table: id int(primarykey), firstname varchar(50), email varchar(50) in child table: mid int(primarykey), mark1 int, mark2 int, id int(foreignkey) in mark table: uid int(primarykey), mark3 int, id int(foreignkey) i'm using query: select id,firstname,mark1,mark2,mark3 (select id,firstname,null mark1,null mark2,null mark3 parent union select id,null firstname,mark1,mark2,null mark3 child union select id,null firstname,null mark1,null mark2,mark3 mark)t group id,firstname,mark1,mark2,mark3 but if make group function using id,firstname,mark1,mark2,mark3 , i'm getting results this so need result possible do? just replace union union all. select id,firstname,null mark1,null mark2,null mark3 parent union select id,null firstname,mark1,mark2,null mark3 child union select id,null firstname,null mark1,null mark2,mark3 mark

loopbackjs - Loopback default values for missing properties when fetching data from MongoDB -

how should define loopback model properties listed in model json file appear on result when properties have no value (or missing) mongodb record? should behaviour configured in loopback or in mongodb? thanks! mongodb schema-less database. designed in way give flexibility adding new fields document without need restart database. don't think idea handle scenario on database side. i think best way handle setting default value every property in loopback model definition. solution has problem when data inserted database outside project. can handle missing parameter @ front-end side. another solution can think of, implementing afterremote method checking existence of fields. in case, can use function after api route want to. can check following link more information: https://loopback.io/doc/en/lb3/remote-hooks.html#signature

java - data provider with arraylist of array in Test NG -

i have send array list of arrays test case using dataprovider annotation. have below code giving illegal argument exception. arraylist size 4096. need give such many arguments in test method. @test(dataprovider="combination_list") public void checkbox_combination(list<int[]> obj) { /*for(int i=0;i<=4095;i++) { }*/ } @dataprovider(name="combination_list") public static object[][] get_combination_list() { list<int[]> combinations_with_int_array = new arraylist<int[]>(); int size_combination; for(int i=0;i<=4095;i++) { string checkbox_combination =combination_list.inttostring(i,12); int[] single_combination = new int[12]; (int j=0;j<=11;j++) { if(j<11) { single_combination[j]=integer.parseint(checkbox_combination.substring(j, j+1)); } else { single_combination[j]=integer.parseint(check

regex - Python - Subtracting a List with strings of a List with Regexes -

i have 2 lists, 1 full of regexes , other full of strings. have check if list strings complete, regex list "complete". want subtract regexes match strings , print leftovers. list regexes: ["ntp server x.x.x.x", "ntp server x.x.x.x", "ntp server x.x.x.x","logging x.x.x.x", "snmp-server community xxxx ro " + regex_string_with_digits_and_special_marks, {"snmp": ["(access-list " + regex_string_with_digits_and_special_marks + " permit x.x.x.x)", "(access-list " + regex_string_with_digits_and_special_marks + " permit x.x.x.x)", "(access-list " + regex_string_with_digits_and_special_marks + " permit x.x.x.x)", "(access-list " + regex_string_with_digits_and_special_marks + " deny\s+any)", "(access-list " + regex_string_with_digits_and_special_marks + " remark .+)"],

ruby - Download Blob file in Rails App is shown inline and not attached -

i blob function in oracle datenbank. users of rails app should able download these blob. problem is, after clicking on download, blob file shown inline in browser, should download file. link: = link_to export_pldw_plausibility_path, :class => "btn btn-primary action-button" %span.glyphicon.glyphicon-pencil %span.hidden-xs = "export" route: resources :pldw_plausibilities 'export', on: :member end controller: def export send_data pldwplausibility.export(params[:id]), :filename => "test.blob", :disposition => 'attachment' end model: def self.export(id) return plsql.pld.pld_mdc.exportmdoc('pld_plausibility', id.to_i) end screenshot sorry! adding :target => "_blank" link solves problem..

c++ - Pixels Overlay With transparency -

i have 2 pixels in b8g8r8a8 (32) format. both pixels (top , bottom) has transparency (alpha channel < 255 ) what way (formula) overlay top pixel on bottom 1 ? (without using 3rd parties). i tried this struct fcolor { public: // variables. #if platform_little_endian #ifdef _msc_ver // win32 x86 union { struct{ uint8 b,g,r,a; }; uint32 alignmentdummy; }; #else // linux x86, etc uint8 b gcc_align(4); uint8 g,r,a; #endif #else // platform_little_endian union { struct{ uint8 a,r,g,b; }; uint32 alignmentdummy; }; #endif //... }; forceinline fcolor alphablendcolors(fcolor pixel1, fcolor pixel2) { fcolor blendedcolor; //calculate new alpha: uint8 newalpha = 0; newalpha = pixel1.a + pixel2.a * (255 - pixel1.a); //get fcolor uint32 uint32 colora = pixel1.dwcolor(); uint32 colorb = pixel2.dwcolor(); uint32 rb1 = ((0x100 - newalpha) * (colora & 0xff00ff)) >> 8; uint32 rb2 = (ne

python - SWIG2 with NUMPY -

i trying build swig2.0 interface c++ class. requirement need able pass numpy array python c++ class. i have simple c++ class : // // file : matmanip.h // #ifndef __mat_manip_h #define __mat_manip_h #include <iostream> class matmanip { public: matmanip(); // matrix of length d void set_matrix( float * m, int d ); }; #endif the .cpp file : #include <iostream> #include "matmanip.h" // file : matmanip.cpp matmanip::matmanip() { std::cout << "constructor\n"; } void matmanip::set_matrix( float * m, int d ) { for( int i=0 ; i<d ; i++ ) std::cout << "m[" << << "] = " << m[i] << std::endl; } my swig interface file (matmanip.i). obtained numpy.i file https://github.com/numpy/numpy/blob/master/tools/swig/numpy.i : %module matmanip %{ #define swig_file_with_init #include "matmanip.h" %} %include "numpy.i" %init %{ import_array(); %} %apply( float

c# - How to create a WebView for IOS -

Image
how can implement uiwebview ios in visualstudio using xamarin.ios , c#? can create webview in storyboard how can define url? and how can current url? click on webview after adding webview in storyboard, properties show @ right-bottom of vs this: add name screenshot shows, press enter. can load url webview in .cs file this: nsurl url = nsurl.fromstring("https://www.google.com"); nsurlrequest urlrequest = nsurlrequest.fromurl(url); webview.loadrequest(urlrequest); to current url of webview when has loaded url via code: webview.request.url.absolutestring;

Kafka Connect Number type fields -

when use kafka connect source rdbms oracle , number type fields seen bytes below, column "id" value "4" number has been sent ,but @ consumer console value has been seen "id":"ba==" what can in order solve issue ? kafka connect started below command connect-standalone ./etc/kafka/connect-standalone.properties /home/kafka/oracle.properties.test ######## connect-standalone.properties # these defaults. file demonstrates how override settings. bootstrap.servers=kafkaserver01.localdomain:9092 # converters specify format of data in kafka , how translate connect data. every connect user # need configure these based on format want data in when loaded or stored kafka key.converter=org.apache.kafka.connect.json.jsonconverter value.converter=org.apache.kafka.connect.json.jsonconverter # converter-specific settings can passed in prefixing converter's setting converter want apply # key.converter.schemas.enable=true value.converter.schemas

ruby on rails - how to store multidimensional array value -

i have store can set directly follows self.xxx_bias_store[i][j] = [7,11] where xxx can different names how set using send. have tried self.send("#{name}_biases_store[#{i}][#{j}]=".to_sym, [7,11]) but has no effect. interested in how retrieve value i.e. send("#{name}_biases_store[#{i}][#{j}]".to_sym) i'm not quite sure why you're trying use send this, , looking @ comment i'm not convinced you're asking right question regardless, here's how works. the methods you're concerned this: class array def [](index) # element of array @ index end def []=(index, value) # set element of array @ index value end end thing[5] calls [] method argument 5 - is, sends method [] receiver thing argument 5 . similarly, thing[5]=1 calls []= method arguments 5 , 1 a multi-dimensional array array made of other arrays, so... thing = [[1,2], [3,4]] p thing.send(:[], 1) # => [3,4] p thing.send(:[], 1).send(:[

octobercms plugins - Does not contain a definition for 'file_src' October CMS -

Image
i working @ october cms plugin development, have problem file upload. put fileupload type file_src . when go to resource shows error : model/resource fields: name: label: name type: text required: true file_src: label: upload type: fileupload grade_id: label: grade type: dropdown emptyoption: select showsearch: true subject_id: label: subject type: dropdown emptyoption: select showsearch: true type_id: label: type type: dropdown emptyoption: select showsearch: true how can fix error? i fixed it! must use $attachone or $attachmany relation on model i added following code in resource.php in models public $attachone = [ 'file_src' => 'system\models\file' ]; thats working now!

Replicate data from Azure-Active-Directory to sql database -

maybe can find solution deep inside developer documetation found here . not on surface, hope can ask following question. we replicate data on-premise active-directory our database store users, groups, units , configure features- , role-permissions our applications. can't (at least not start scratch) authorize features calling azure-active-directory api know if possible replicate needed objects azure-ad can ad? if yes, if has link reference make day while continue seek information. thanks. yes, able replicate data azure ad through azure ad graph rest. azure ad different active directory on-premise. example, there no organizational units. you can check exposed object in azure active directory via link below: entity , complex type reference | graph api reference and started azure ad graph rest, can refer azure active directory graph api . since microsoft working on microsoft graph, if there no such object in azure ad graph rest, may check microsoft graph rest

javascript - How to get random element in Vue.js -

i have 3 hero images , content , want display them randomly when user refreshes page! basically trying display random div using jquery on loading page, issue size of hero image large , using jquery , these 3 images start loading in dom affects speed of page. is there solution in vue.js loading 1 specific div @ time, not 3 divs when user refreshes page!? <div class="slider-item"> <img src="../../../static/img/slides/slide1.png" alt="hello"> <div class="carousel-caption"> <h2>lipsum heading</h2> <h4>lipsum dummy content body test dummy goes here.</h4> </div> </div> jquery code: mounted() { var random = math.floor(math.random() * $('.slider-item').length); $('.slider-item').eq(random).show(); }, everything pretty straight forward. randomize link you've chosen in vue. const app = new vue({ el:

c# - Equals is used. GetHashCode is not -

i have implemented class below: public class carcomparer : iequalitycomparer<car> { public bool equals(car car1, car car2) { if (car1 == null || car2 == null) return false; return (car1.description == car2.description); } public int gethashcode(car car) { unchecked { int hash = 17; hash = hash * 29 + car.id.gethashcode(); hash = hash * 29 + car.description.gethashcode(); return hash; } } } now see this: car p1 = new car() { id = guid.newguid(), description = "test1" }; car p2 = new car() { id = guid.newguid(), description = "test1" }; car p3 = new car() { id = guid.newguid(), description = "test1" }; car p4 = new car() { id = guid.newguid(), description = "test1" }; var hash = new hashset<

html - @media (max-width: 767px) { /*content*/} does not work -

so trying make webpage responsive , few days before found main css modification makes webpage responsive @media rule problem @media (min-width: 768px) , (max-width: 979px) { .dropdown-content { margin-left:10% } } this part of bootstrap-responsive.css refer tablet window version of webpage working fine. when switch mobile window version i.e. max-width :767px; html page not read it @media (max-width: 767px) { .dropdown:hover .dropdown-content { display:none; } } this part of code not read in mobile window version. want utilize first css code above during tablet version , second css code above during mobile version. related js file or missing else? please me solution. edit:- have changed attributes above , added html code down here <li class="dropdown"> <a href="policies.php">policy</a> <div class="dropdown-content"> <!--dropdown-content div--> </div> </li>

javascript - JMeter WebDriver Sampler: working with Firefox but browser does not open when using Chrome -

i have been able run (javascript) test script using webdriver sampler in jmeter firefox driver config. want use jmeter chrome driver config run same test in chrome. i know chrome driver have installed on pc working have used run other (non-jmeter) tests. path chrome driver correct. my site not use proxy have selected "no proxy" under "proxy" tab of chrome driver config. problem : when click "run" in jmeter firefox driver config disabled , chrome driver config enabled, nothing happens (browser not open, test ends , nothing recorded in "view results tree" listener). i using version 3.1 of jmeter, version 60.0.3112.101 of chrome , version 2.31 of chromedriver. my code looks in case helps: var pkg = javaimporter(org.openqa.selenium); //webdriver classes var pfg = javaimporter(org.openqa.selenium.keys); //webdriver classes var support_ui = javaimporter(org.openqa.selenium.support.ui.webdriverwait); var wait = new support_ui.webdriverw

jquery - Table with fixed header, first column and footer + Scroll inside -

Image
i have create table contains lot of data. therefore, need finding solution how make flexible not fill space. i have thought should work shown in picture here: you can make class on part like: .block { display: block; overflow: auto; } <table> <tr> <th>...</th> <th>...</th> </tr> <tr> <td>....</td> <td class='block'>lot of data</td> </tr> </table>

php - i want to apply condition on foreach -

i want apply condition on json array using php here display data has type discursive my json file here code trying not showing data want <?php $obj2 = json_decode($blog_data); foreach(array_reverse($obj2->blogs) $blog) { if($obj2>b_type == 'discursive') { ?> <h3> <?php echo $blog->name; ?></h3> <span> <?php echo $blog->date; ?> </span> <p><?php echo $blog->b_text; ?></p> <?php } else{ echo "no discursive event"; } } ?> try this: <?php $obj2 = json_decode($blog_data); foreach(array_reverse($obj2->blogs) $blog) { if($blog->b_type == 'discursive') { ?> <h3> <?php echo $blog->name; ?></h3> <span> <?php echo $blog->date; ?> </span> <p><?php echo $blog->b_text; ?></p>

mongodb - Export data to csv file using $in -

i trying export data csv file using mongo export condition following command mongoexport --db <db_name> --collection <coll_name> --query "'meta.metadata.fieldname' : {$in : [ezr-2016-21123,ezr-2016-22016, ezr-2016-23420]}}" --fields <field_name> --type=csv --out out_file_name.csv this works fine other normal query, when put $in, doesn't work. you need updated query following mongoexport --db <db_name> --collection <coll_name> --query "{'meta.metadata.fieldname' : {'$in' : ['ezr-2016-21123', 'ezr-2016-22016', 'ezr-2016-23420']}}" --fields <field_name> --type=csv --out out_file_name.csv you missing starting { off query strings within $in array need quoted

Angular 2 : Create Div on the Fly by Iterating Over Objects -

this question has answer here: observable angular 4 , ngfor supports binding iterables such arrays 2 answers i create div's on fly iteration on objects in json variable. i know how create if had iterate on array of arrays not on objects my json following { "physics" : { "subjectcode": 101, "subjectname": "physics", "sectiona": 200, "sectionb": 500, "sectionc": 158, }, "chemistry" : { "subjectcode": 102, "subjectname": "chemistry", "sectiona": 200, "sectionb": 500, "sectionc": 158, }, "maths" : { "subjectcode": 102, "subjectname": "maths&