Posts

Showing posts from September, 2012

javascript - jQuery Datatable cell not updating -

Image
i have table using jquery datatables with. picture: scenario: as can see in picture, there delete link. when link clicked, modal pop-up show asking user if want delete item. if yes, delete.. if no.. cancel out of modal. what want: when user decides delete item , confirms it.. change status of item "deleted", via ajax. able change value, value not show in table. have researched couple of days now, nothing seems work. my code <table id="item-table" class="table table-bordered"> <thead> <tr> <th class="text-center"> @html.displaynamefor(model => model.assettag) </th> <th class="text-center"> @html.displaynamefor(model => model.codemakemodel.makemodel) </th> <th class="text-center"> @html.displaynamefor(model => model.codestatu.status) </th> &l

jquery - Prevent CSS from loading at all -

i've got site platform html , css built upon on complete lock down. 0 access application/server layer. there few css files served platform , i've stripped them out little jquery $(document).ready(function() { $('link[rel=stylesheet][href*="userglobal"]').remove(); }); while work , prevents "userglobal" stylesheet having impact on page presentation still loaded. my question is, in absence of access application layer/server side of things there way prevent css file being delivered browser in first place? my gut tells me no - i'd interested in hearing if has come across similar , solved it. using javascript, there no way prevent css file being loaded browser if css included (either <link> or <style> tags) on html page. you'll need way alter web server's http response (i.e. remove css) if want prevent browser loading it.

android - Style DatePickerDialog selector background -

Image
does know how style black boxes surrounding date selectors match background of datepickerdialog? for reference here style i'm using alertdialogs: <style name="alertdialogstyle" parent="theme.appcompat.light.dialog.alert"> <item name="android:windowbackground">@android:color/white</item> <item name="android:colorbackground">@android:color/white</item> <item name="coloraccent">@color/group_blue_800</item> <item name="android:textcolorprimary">@color/secondary_text</item> <item name="android:textcolor">@color/primary_text</item> <item name="android:linespacingmultiplier">1.2</item> <item name="colorcontrolnormal">@android:color/white</item> <item name="colorprimary">@android:color/white</item> <item name="colorprimarydark">@and

algorithm - Number of ways from top left to bottom right of an array -

i playing around following problem: given 2-d array find possible ways can move top left cell [0][0] bottom right cell [n-1][n-1] given can move either downward or rightward? i defined following: array such [ [ 1 ] ] there 1 way go start cell destination cell. there. otherwise total number of ways total number of ways go cell right destination plus 1 (there 1 way go current cell next cell) plus total number of ways go cell bellow destination plus 1 (there 1 way go current cell bellow cell) array such as: [ [1, 2] [3, 4] ] the answer 4 (1->2, 2->4, 1->3, 3->4). array such as: [ [1, 2, 3], [3, 4, 5], ] the answer should 8. 4 comes subarray right + 1 go (1)->(2) plus 1->3 3->4 4->5 total 3. 5 + 3 = 7. following code seems me correct messing , wrong result. my $array = [ [1, 2, 3], [3, 4, 5], ]; sub number_of_ways { ( $input, $source_row, $source_col, $dest_row, $dest_col ) = @_; if (

javascript - Converting text to hexadecimal on mac -

i trying convert text hexadecimal characters in order build dmg on mac. i'm getting burned fact hexadecimals not seem refer same characters on mac , windows ascii characters > 127. , seems basic javascript functions give "windows" translation. need "mac" translation hexadecimal... i'm doing far: const filedata = await parsejson(readfile(item.file, "utf-8")) const buttonsstr = labeltohex(filedata.lang) function labeltohex(label: string) { return hexencode(label).tostring().touppercase() } function hexencode(str: string) { let let result = "" (i = 0; < str.length; i++) { result += unicodetohex(str.charcodeat(i)) } return result } function unicodetohex(unicode: number) { const hex = unicode.tostring(16) return ("0" + hex).slice(-2) } if pass in: français éàè i get: 46 72 61 6e e7 61 69 73 e9 e0 e8 but when read back, get: franÀais ȇË i'm expecting get: 46 72 61 6e 8d 61 69 73

stm32 - Activating DFU (USB programming) on STM32F303 -

Image
i building board based on stm32f303ret6. the processor datasheet , page 17/section 3.5, mentions programming can done "using usart1 (pa9/pa10), usart2 (pa2/pa3) or usb (pa11/pa12) through dfu (device firmware upgrade)" i using nucleo board processor. i have connected vdd, gnd, d+ , d- pins of usb nucleo board , disabled power add-on programmer board. however whenever reboot boot0 high usb never enumerates device. connecting pins directly usb plug without external resistor. datasheet seems suggest these not needed. to make things bit trickier, processor has additional particularity of not having boot1 pin; software bit. my question is, processor support dfu using built in bootloader? if so, how should 1 go starting , programming via usb? thank much, pedro. ps: st has got conflicting information support usb programming on processor. while datasheet says it's supported, application note an2606 , page 81 (section 19) mentions support programming via usart

Retrieving list member information from mailchimp - limited fields returned - PHP -

trying synchronize member information mailchimp our local db. able request information, fname, lname , birthday fields. calling function: $mailchimp_v3_service->get_list_members($list_id, $count, $offset) and getting list of stdclass objects: stdclass object ( [id] => <an id> [email_address] => <an email> [unique_email_id] => <a unique email id> [status] => unsubscribed [merge_fields] => stdclass object ( [fname] => testable [lname] => contact [birthday] => ) ) looking @ function call inside mailchimp code (mailchimpv3service.php), looks requesting more/different fields getting: fields=members.id,members.email_address,members.status,members.unique_email_id,members.merge_fields.lname,members.merge_fields.fname,,members.merge_fields.phone it looks function requesting phone, , not requesting birthday. any thoughts? ok, figured out issue - our support team adding phone number

android - ReactNative app is successfully installed but it's not started from WebStorm -

when try build reactnative app devices this: build successful total time: 25.191 secs build faster, please consider using gradle daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html starting app (adb shell start -n com.neborofeed/com.neborofeed.mainactivity.../bin/sh: adb: command not found the app installed on device, it's not started automatically. when copy command terminal adb shell start -n com.neborofeed/com.neborofeed.mainactivity , app started expected. it's seems script not able find adb, have added path in ~/.bash_profile or similar? if have not try running: echo "export path=\$path:/users/${user}/library/android/sdk/platform-tools/" >> ~/.bash_profile if have sdk in different directory, update path in command above.

java - ArrayIndexOutOfBoundsException - Can't find the error in my method -

i'm trying figure out made mistakes in code can't out of it. i'm writing simple hangman game code. seems work until wrong letter typed in jtextarea. error appears located in "gioca()" method. here's code: package giocoimpiccato; //frame in cui si visualizza il gioco. qui c'è il metodo main. import java.util.arraylist; import java.util.random; import javax.swing.imageicon; //composto da 1 jlabel per la foto, 1 jlabel per il titolo, 1 jlabel per il risultato, 1 jlabel per le lettere inserite, 1 jlabel per la parola e 1 jtextarea per inserire le lettere public class giocoimpiccatoframe extends javax.swing.jframe { public string paroladaindovinare; public arraylist<string> lettereusate; //uso un vettore perchè ha grandezza variabile public int tentativi = 6; public arraylist<integer> letteretrovate; public int sfondocount = 0; public imageicon[] sfondi; //uso un array perchè ha grandezza fissa public int sfondousato = 0; public stri

Array of 2-D array C#? -

can define array of 2d array in c# of manner? or alternate approach obtain similar dataset? double[][,] testarray = new double[a][b,c]; note: 3 indices - a,b , c obtained in runtime. thanks you can it, have initialize each 2d array separately : double[][,] testarray = new double[a][,]; for(int = 0; < a; i++) { testarray[i] = new double[b, c]; } another way declare 3d array: double[,,] testarray3d = new double[a, b, c]; that is, can make change if every 2d array wanted in beginning have same dimensions

python - Finding largest biclique containing certain vertex -

given bipartite graph g , selected vertice v, want find maximal biclique v belongs to. i appreciate if shows me algorithm, implementation or paper problem. take of v 's neighbors 1 side of biclique, , take intersection of of v 's neighbors' sets of neighbors other side. result maximal biclique containing v .

linux - Usage of dup2() -

dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); if (fd > 2) close(fd); according book advanced programming in unix environment, if statement above necessary. book suggests work through considering happen if fd = 1 in 1 case, , if fd = 3 in another. if fd = 1, 0 (stdin) closed , point @ stdout, 1 still point @ stdout (since dup2() doesn't close file descriptor if it's equal first argument, , return 1) , 2 point @ stdout. if fd = 3, every file descriptor first closed , point @ whatever file 3 points at. why necessary close descriptor if it's greater 2? the purpose of dup2 call copy first file descriptor second. after 3 calls dup2 , file descriptors 0, 1, , 2 open , copies of file descriptor fd . subsequent call close closes original file descriptor. if didn't check fd > 2 prior calling close(fd) , closing 1 of file descriptors opened. example, if fd 2 close(fd) same close(2) . it doesn't make close file descriptor right after opening ,

date - makedate from lubridate with year, month, and week in R -

this question has answer here: transform year/week date object 1 answer i have data has columns year, month, week. how can convert date lubridate . examples in documentation use year, month, , day. lets assume following data year month week 2017 1 1 2017 2 35 2017 3 50 how can use. makedate() above data? a potential solution using base posixct . df$complete_date <- as.date(paste(df$year, df$week, 1, sep="-"), "%y-%u-%u") does produce desired result? year month week complete_date 1 2017 1 1 2017-01-02 2 2017 2 35 2017-08-28 3 2017 3 50 2017-12-11

python - Converting cURL POST into urllib2 without Requests -

i have curl command works in environment. need convert python 2.7 urllib equivalent , need assistance curl command in question: curl -k -v -xpost -h "authorization: bearer $token" -f file=@${local_filename} https://interesting_url.com/ i need ability support both header (-h) , form/file (-f) , have yet successful. this post includes discussion on headers , have not been able '-f' equivalent working with python3 can requests : import requests headers = {'authorization': 'bearer $token'} files = [('file', open('${local_filename}', 'rb'))] requests.post('https://interesting_url.com/', headers=headers, files=files, verify=false) uploading files urllib2 quite complicated task ( example ). suggest requests . long answer without using pip , third-party packages you can implement custom class multipartform , use encode files: import itertools import mimetools import mimetypes cstringio import s

c# - React to new contact on Skype -

i create system add record database(might microsoft azure) when adds skype contact list. i can see activity type contactrelationupdate of bot might trigger action, though have noticed skype bot separate profile. possible bot functions attached personal skype, action can triggered on invitation? maybe possible done other api? thanks

javascript - How can I hide hAxis labels in Google material bar chart? -

i show stacked bar chart grouped bars , 1 row of horizontal axis labels. found, not possible show stacked barchart grouped bars using visualization.barchart of google visualization api v44 , possible material bar chart using series array option. for example: google.charts.load('44', { packages: ['corechart', 'bar'] }); google.charts.setonloadcallback(drawchart); function drawchart() { var data = new google.visualization.datatable(); data.addcolumn('string', 'nothing'); data.addcolumn('number', 'blue'); data.addcolumn('number', 'blue'); data.addcolumn('number', 'blue'); data.addcolumn('number', 'blue'); data.addcolumn('number', 'blue'); data.addcolumn('number', 'red'); data.addrows([ ['row 1', 14, 1, 3, 0, 1, 36], ['row 2', 10, 1, 0, 2, 2, 23], ]); var options = {

Strange screen rotation behaviour in Android -

i have 2 activities in app. the main activity displayed when device in portrait position, , when device turned landscape 'summary screen' activity (showandtellactivity) started. this part of app seems work reliably , achieved following: @override public void onconfigurationchanged (configuration newconfig) { super.onconfigurationchanged(newconfig); int orientation=newconfig.orientation; switch(orientation) { case configuration.orientation_landscape: show_and_tell_intent.setclass(getapplicationcontext(),showandtellactivity.class); show_and_tell_intent.putextra("each_pays", v_currency_symbol.concat(new decimalformat("0.00").format(v_each_to_pay))); startactivity(show_and_tell_intent); break; case configuration.orientation_portrait: break; } } the summary activity contains following code finish() activity when device rotated portrait position: @ove

android - listview adapter doesnt want to set text -

ok trying simple listview filling array adapter have: public class mainactivity extends activity { string[] dish = {"soup", "rice", "grecha", "potato"}; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.lunch); setrequestedorientation(activityinfo.screen_orientation_landscape); setcontentview(r.layout.lunch); listview lunchlv = (listview)findviewbyid(r.id.lunchlv); cafeadapter ca = new cafeadapter(); lunchlv.setadapter(ca); } public class cafeadapter extends baseadapter { @override public int getcount() { return dish.length; } @override public object getitem(int i) { return null; } @override public long getitemid(int i) { return 0; } @override public view getview(int i, view view, viewgroup viewgroup) { view = getlayoutinflater().inflate(r.layout.list, nul

ios - Alamofire - NetworkReachabilityManager doesn't work with .notReachable -

i have issue networkreachabilitymanager alamofire . tried test connection example code: override func viewdidload() { super.viewdidload() let manager = networkreachabilitymanager(host: "www.apple.com") manager?.listener = { status in switch status { case .notreachable: print("network connection status - lost") case .reachable(networkreachabilitymanager.connectiontype.ethernetorwifi): print("network connection status - ethernet/wifi") case .reachable(networkreachabilitymanager.connectiontype.wwan): print("network connection status - wwan") default: break } } manager?.startlistening() } when tried turn wifi off , received blank response. no response such "network connection status - lost". but when tried turn on wifi , received result "network connection status - ethernet/wifi" in response. idea wrong .notreachable ? suggesti

python - What are the differences between kivy.properties.Clock and kivy.clock.Clock? -

is there difference between kivy clock modules found @ kivy.properties.clock , kivy.clock.clock ? , if so, pros , cons of each? every example i've seen uses kivy.clock.clock , has documentation . there doesn't seem documentation kivy.properties.clock . both classes same at time . clock defined in kivy/clock.py . imported in kivy/properties.pyx . therefore clock name available in module namespace. so technically, it's possible import kivy.properties won't advice that. the maintainers may make change clock intend isolated original class definition , private.

python - how do I keep a program running -

this question has answer here: how keep python script output window open? 14 answers every time run python file , cmd pops after enter of inputs closes. wondering how keep can display output without making new input. you can pause execution of python script waiting input . if don't want additional input, on windows can use msvcrt wait keypress without showing prompt, e.g. import msvcrt def wait(): msvcrt.getch() then add wait() script want pause. if add @ end of script pause , wait key press before closing window.

PHP merge arrays if they have the same key value -

i have array of associative arrays. $array = [ ['report_date' => 'date', 'name' => 'name'], ['report_date' => 'date', 'color' => 'color'] ]; i want sort through array , if $array[x]['report_date'] === $array[y]['report_date'] then need perform merge return in case: $newarray = [['report_date'=>date,'name'=>name,'color'=>color]] of course need take account there may multiple arrays fulfill requirement , have merge them well. i've tried couple of things, resulted in mapping , foreach merges took forever process , in end couldn't working. any ideas? you can create new array, indexed report_date , push values it: $out=[]; foreach($array $subarray){ foreach($subarray $key=>$val){ $out[$subarray['report_date']][$key]=$val; } } var_dump($out);

JSP page's form not validating data with my Javascript -

issue the problem is, jsp sends form servlet, without validating javascript. javascript function testinputtext() { var x, text; x = document.getelementbyid("inputtext").value; if (typeof x != "string") { text = "invalid input js"; document.getelementbyid("scripterror").innerhtml = text; return false; } else if(x ==""){ text = "no input found js"; document.getelementbyid("scripterror").innerhtml = text; return false; } else {text = "valid js"; document.getelementbyid("scripterror").innerhtml = text; return true; } } formular.jsp <!doctype html> <html> <head> <script src="javascripts/mailvalidation.js"></script> <title>formular</title> </head> <body> <form name="formular" onsubmit=&q

ruby on rails - NoMethodError in StylesController#new undefined method `styles' for nil:NilClass -

im getting error ruby on rails. made scaffold called style has title , description(string , text), user session ruby gem devise , model called category added style add_category_id_to_styles . changed the def new @style = style.new end to def new @style = current_user.styles.build end in style controller , giving me undefined method 'styles' nil:nillclass. of know why giving me error? devise provides method #user_signed_in? check if current user signed in. if yes have access #current_user . can have: def new @style = user_signed_in? ? current_user.styles.build : style.new end of course can check current_user.present? directly think #user_signed_in? conveys intention better.

python - sqlite3 DatabaseError: database disk image is malformed multithread -

i trying query sqlite3 database multiple threads , getting error intermittently (some times when run , other times not) idea of how prevent happening thanks process process-72: traceback (most recent call last): traceback (most recent call last): file "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap file "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() self.run() file "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) file "/scratch/retrosynth/retrosynth/rs/rs.py", line 341, in _retrieve_shortestpath file "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) file "/scratch/retrosynth/retrosynth/rs/rs.py", line 341, in _retrieve_shortestpath optimal_pathways[0]) file "/scratch/retrosynth/retrosynth/rs/parse

html - Chrome makes bounce image in bootstrap carousel -

i have following website: http://huertalia.mx/universidadeswp/site/ <div style="" id="carouseldocumentationindicators" class="carousel slide hidden-xs-down" data-ride="carousel"> <div class="carousel-inner" role="listbox"> <div class="carousel-item active"> <img class="d-block img-fluid carousel-img" src="assets/img/index/carousel/1_2.jpg" alt="first slide"> <div class="carousel-caption left-caption text-left"> <h4 style="padding-left: 30px;" id="univ-click2">soy universitario</h4> </div> </div> <div class="carousel-item"> <img class="d-block img-fluid carousel-img" src="assets/img/index/carousel/2_2.jpg" alt="second slide"> <div class="carousel-caption left-caption text-left"> <h4 style=&q

android - how to stop music if application in background -

i'm trying stop music when user leave app or click (home button) , application plays music if in background, how can stop music if user click home button ? if user returns, music played again ? code : protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mediaplayer = mediaplayer.create(getapplicationcontext(), r.raw.vaporv2); if(!mediaplayer.isplaying()){ mediaplayer.start(); } mediaplayer.setoncompletionlistener(new mediaplayer.oncompletionlistener() { public void oncompletion(mediaplayer mp) { mediaplayer.start(); } }); //toggle off , on : musicbutton = (togglebutton) findviewbyid(r.id.togglebutton); musicbutton.setoncheckedchangelistener(new oncheckedchangelistener() { @override public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { if (musicbutton.ischecked() && mediapl

android - Cordova Native Audio - Multi audio at same time -

how can play @ same time multi sounds selected check boxes? for example, lets say, have 5 check boxes , select 3 of them play @ same time. i trying use cordova native audio plugging implement this. right now, following docs, have this: // preload audio resources window.plugins.nativeaudio.preloadcomplex( 'pewpewpew', 'assets/pewpewpew.mp3', 1, 1, 0, function(msg){ }, function(msg){ console.log( 'error: ' + msg ); }); window.plugins.nativeaudio.preloadcomplex( 'soldier', 'assets/soldier.mp3', 1, 1, 0, function(msg){ }, function(msg){ console.log( 'error: ' + msg ); }); window.plugins.nativeaudio.preloadcomplex( 'effects', 'assets/effects.mp3', 1, 1, 0, function(msg){ }, function(msg){ console.log( 'error: ' + msg ); }); // play window.plugins.nativeaudio.play( 'pewpewpew' ); window.plugins.nativeaudio.loop( 'soldier'

javascript - Is my understanding of WebRTC protocol Correct? -

this how understand protocol... user on browser media stream generates own sdp (data on codecs, security, etc) creates offer it send offer server via signalling method (websocket) signalling server, looks offer , redirect client client 2's browser gets offer sdp , in turn generate own offer own sdp , send server server redirect client 2's offer client 1. both know each other specs. meanwhile, however... as whichever client sends offer sdp start contact ice (stun) server(s) possible reachable path them via correct publicip:port:protocol combo, send client via signalling server. client 2 generates answer (using createanswer), not offer. main difference answer subset of capabilities (like codecs) contained in offer. otherwise sounds good.

Challenge: Return number of objects in an image using Python's pillow library (PIL) -

challenge: possible create method count number of objects contained in image using pil library? image gray scale, instance plain white background 3 black circles return integer 3. have been messing around imagefilter quite bit can't seem find i'm looking for. know can done using other libraries unfortunately not have access them. ok, have currently: def get_num_objects(im_1): count_objects = 0 edges = im_1.filter(imagefilter.find_edges) edge_data = edges.load() # need way count edges edge in edge_data: count_objects += 1 return count_objects i realize objects may have multiple edges , trying iterate through edge_data return error. i'm not finding in docs looks work i'm trying achieve. thanks. yes possible. there no built-in function want. you'll have implement yourself.

javascript - How to force Instagram to open a link in Safari rather than the in app browser -

instagram has added inapp browser automatically used when links opened. websites need opened in normal browser such safari (for iphone). trying figure out how force redirect proper browser. if link opened through instagram browser, request opened in safari, , trying this: http://ogurl.co/boj to answer question, in app browser instagram or app design decision made producer of application , cannot changed user unless configuration provided. if instagram provides setting open links in different browser, way make happen.

amazon s3 - Can SNS pass user-metadata to rest layer after object created event? -

i need pass user-metadata when perform put action add new objects s3 bucket. after file uploaded (object created), s3:objectcreated:put pass notification rest api method call further processing. i have found doc on how pass user-metadata put operation, not doc on how make sns message contain user-metadata when sending message rest api method. would sns message automatically contain user-metadata newly created object or have perform additional configuration make happen? update: should generate head request using node.js: let authstring: string = "aws akiaiosfodnn7example:02236q3v0ronhpabx5scyvf1bnruu="; var options = { host: 'bucket.s3.amazonaws.com', path: '/filename.jpg', method: 'head', headers: { 'authorization': authstring, 'date': 'date: wed, 28 oct 2009 22:32:00 gmt' } }; var req = https.request(options, function(res) {

python - Setting up Chrome desired caps -

i need set desired caps chrome. code made android device, need change desired caps make work same web browser chrome, not android. def setup(self): print('setup') print('serial %s'%self.serial) self.dbinstance = dbconnection() if not self.dbinstance.cfg: print('cannot load db configuration file') return capabilities = getcapabilities(self.serial,self.dbinstance.db) desired_caps = {} desired_caps['platformname'] = 'android' desired_caps['platformversion'] = capabilities.platform_version desired_caps['devicename'] = capabilities.device_name desired_caps['apppackage'] = capabilities.app_package desired_caps['appactivity'] = capabilities.app_activity self.driver = webdriver.remote('http://'+capabilities.appium_server+':'+capabilities.appium_port+'/wd/hub', desired_caps) so if change to: def setup(self): print('

javascript - How to change placeholder and name from select option dynamically using jQuery -

Image
if need edit question please state before down voting. i'm creating form when option selected. form appear depends on option selected. how dynamically change placeholder , name. if option selected multiple times placeholder , name increment like placeholder="holder1" name="name1" placeholder="holder2" name="name2" here's code: twig file <select class="form-control" id="collaterals" name="loan_type_id" required> <option disabled value="0" selected}>-- select collateral --</option> <option value="" id="veh_coll">vehicle</option> <option value="" id="hal_coll">house , lot</option> <option value="" id="lot_coll">lot</option> </select> jquery jquery(document).on('click',"#removethis",function(e){ jquery(this).closest('tr')

javascript - Centering the map marker on a Reveal Modal Foundation -

Image
it happens after opening modal, map not shown, forced solve script resizes map within application.js (i'm using rails framework) $(document).ready(function(){ $(document).foundation(); $(document).on('open.zf.reveal', '[data-reveal]', function () { window.dispatchevent(new event('resize')); }); }); however, although shows map in modal, marker not displayed in middle, shown 1 side, this: how can when image resized, center marker? thank help, here code: index.html.erb <div class="full reveal" id="mapmodal" data-reveal style="width: 100%;"> <div id="map" style="width: 100%; height: 280px;"></div> <script type="text/javascript"> handler = gmaps.build('google'); handler.buildmap({ provider: { gesturehandling: 'greedy' }, internal: { id: 'map' }}, function(){ markers = handler.addmarkers(<%=raw @hash.to_json %>

recommendation engine - Ad recommender system in python -

i have tried use following lib create simple ad recommender system: http://surpriselib.com/ surprise lib stricts data folds structure: such file assumed specify 1 rating per line, , each line needs respect following structure: user ; item ; rating ; [timestamp] i work simple structure without rating : user_id ad_id it defines user clicks on ads. need kind of collaborative filter suggest proper ads user. should use other library doing or there other ways creating ad recommender? for building recommender system can use graphlab create library also includes sample application recommender application. https://github.com/turi-code/sample-movie-recommender for details refer: https://turi.com/learn/userguide/recommender/introduction.html

python - Discrepancy of the state of `numpy.random` disappears -

there 2 python runs of same project different settings, same random seeds. the project contains function returns couple of random numbers using numpy.random.uniform . regardless of other uses of numpy.random in python process, series of function calls in both of runs generate same sequences, until point. and after generating different results 1 time @ point, generate same sequences again, period. i haven't tried using numpy.random.randomstate yet, how possible? is coincidence somewhere uses numpy.random caused discrepancy , fixed again? i'm curious if possibility or there explanation. thanks in advance. add: forgot mention there no seeding @ point. when use random module in numpy, each randomly generated number (regardless of distribution/function) uses same "global" instance of randomstate . when set seed using numpy.random.seed() , set seed of 'global' instance of randomstate . same principle random library in python. i

tf slim - distributed tensorflow clarification -

is understanding correct model_deploy lets user train model using multiple devices on single machine? basic premise seems clone devices variable sharing , variables distributed param servers in round-robin fashion. on other hand distributed tensorflow framework enables user train model through cluster. cluster lets user train model using multiple devices across multiple servers. i think slim documentation slim , point has been raised couple of times already: configuration/flags tf-slim across multiple gpu/machines thank you.

symfony - How can i override easyAdminBundle Controller -

i want know how override easyadminbundle controller. actually, want write custom query database , don't want use dqlfilter. following config.yml file. easy_admin: site_name: 'site mame .' entities: user: class: employeebundle\entity\employeelogin controller: employeebundle\controller\usercontroller form: fields: ['id', {property : 'username', label : 'users'}, {property: 'status', type:'choice', type_options: {choices: {'active':'1', 'deactive':'0'}}}] new: title: 'add login' form_options: { validation_groups: ['default', 'employeelogin'] } fields: ['-id'] edit: title: 'edit login details' form_options: { validation_groups: ['default'] } label: 'employees'

linked list - How can i make this java node searchandadd method work by passing object? -

here code: public void searchandadd(object tofind,object toadd) { node prev=null; node curr=head; node newnode=new node(toadd); curr=new node; while(curr!=null&&newvalue>curr.item) { prev=curr; curr=curr.next; } } how can make method work in java? , in advance :)

java - Watchservice in windows 7 does not work -

Image
this code works fine in linux not in windows 7: file contents update have click on output file. trick? i using windows 7 prof, netbeans ide 8.0 rc1 (build 201402242200) updated version netbeans 8.0 patch 1.1, jdk 1.8 package watchfilethreadmod; import java.io.filenotfoundexception; import java.io.ioexception; import java.io.randomaccessfile; import java.nio.file.files; import static java.nio.file.linkoption.nofollow_links; import java.nio.file.path; import java.nio.file.paths; import static java.nio.file.standardwatcheventkinds.*; import java.nio.file.watchevent; import java.nio.file.watchkey; import java.nio.file.watchservice; import java.util.arraylist; import java.util.list; import java.util.logging.level; import java.util.logging.logger; public class watchfilethreadmod { static class watchfile { string filename; long lastfilepos; randomaccessfile file; public watchfile(string _filename, randomaccessfile _file) { filename = _filename; las