Posts

ruby on rails - Creating user invite button with Facebook API -

i'm trying create button on 1 of pages allows users invite friends use web app them. when click on link i've created invite button, nothing happens. missing? i'm new coding i'm little bit lost next. show.html.erb file: <% if current_user %> <div id="friends"> <p> <%= link_to "invite facebook friends", '#', :id => 'invite_fb_friends' %></p> <div id="fb-root"></div> <script src="http://connect.facebook.net/en_us/all.js"></script> <script> $(function(){ $("a#invite_fb_friends").click(function(){ fb.init({ appid:'my app id', cookie:false, status:true }); fb.ui({ method: 'apprequests', message: '<%= @user %> invited collaborate on story.'} requestcallback;); };) }); </script> </div> <% end %> i'm using these ge...

python - Select all adjacent elements without copying the numpy array -

i have bunch of points format point = [time, latitude, longitude] . so, have got myself numpy array looks - points = numpy.array([ [t_0, lat_0, lon_0], [t_1, lat_1, lon_1], [t_2, lat_2, lon_2], ... [t_n, lat_n, lon_n], ]) now, need gives me next , previous points each of these points like: next_points = numpy.array([ [t_1, lat_1, lon_1], [t_2, lat_2, lon_2], ... [t_n, lat_n, lon_n], [nan, nan, nan], # note how `nan` put next not exist ]) prev_points = numpy.array([ [nan, nan, nan], [t_0, lat_0, lon_0], [t_1, lat_1, lon_1], [t_2, lat_2, lon_2], ... ]) so, can apply distance function - next_distances = distance_function(points, next_points) prev_distances = distance_function(points, prev_points) now, task appears in function gets called in loop around 1000 times, it nice if next_points , prev_points without creating copy of points . is there way this? if understand correctly, shifting ...

weblogic12c - Stop weblogic server forcefully using command line -

i want shutdown weblogic server using command line forcefully. have specific scenario. have written batch file stuff , shutdown weblogic server using stopweblogic.cmd follows: "%weblogic_domain_path%\bin\stopweblogic.cmd" i have gone through this document. can't follow approach since don't want change stopweblogic.cmd . there way achieve this? a wlst script way go. see shutdown command has optional 'force' parameter. n.b. on unix/linux can send sigterm signal pid of weblogic server perform force shutdown. i.e. kill -term pid

javascript - Insert jsonobject into new array -

say have following jsonobject var arraywithvaluesandgroups = [{ "testobject": "object1", "graphgroup": { "test": { "group": "a", "value": "6" }, "test2": { "group": "b", "value": "5" } } }, { "testobject": "object2", "graphgroup": { "test": { "group": "a", "value": "9" }, "test2": { "group": "b", "value": "12" } } }, { ...

jQuery Snake Carousel Effect -

Image
i can't seem find this, asking see if point me in right direction. i need products slide around conveyor belt/with snake effect. view on js fiddle: http://jsfiddle.net/nlgopodt/2/ crude diagram of functionality required attached. i going css only, couldn't :nth-child selector work correctly. anyhow, updated jsfiddle every column in row. every even row floats columns right the javascript prepends columns first row , cascades overflowing columns next row if there no next row, removes overflowing elements. .container .row:nth-child(even) .col { float: right; } var $rows = $('.container .row'); setinterval(function(){ var $col = $('<div class="col new">new col</div>'); $rows.eq(0).prepend($col); $col.removeclass('new').addclass('animated bouncein') $rows.each(function(idx, elem){ var $row = $(elem), $cols = ...

c# - Retrieve document template type from SPList -

when working in sharepoint creating custom splist using following method: from msdn : public virtual guid add( string title, string description, string url, string featureid, int templatetype, string doctemplatetype, splisttemplate.quicklaunchoptions quicklaunchoptions ) the doctemplatetype passed declare document template type. possible retrieve document template type existing splist? can useful i.e. when copying list. thanks in advance. use splist.basetemplate property list definition type on list based, example: splist list = web.lists.trygetlist(<list title>); splisttemplatetype templatetype = list.basetemplate; int templatetypeid = (int) templatetype; how document template associated list splist list = web.lists.trygetlist(<list title>); var doctemplate = web.listtemplates.oftype<splisttemplate>() .firstordefault(lt => lt.type == list.basetemplate); console.writeline(...

php - mysqli_prepare() expects parameter 1 to be mysqli, object given -

alright. basically. here's code. login.php require_once("./libs/db_cxn.php"); $cxn = new newconnection(); $stmt = "select users.username users username=$username , password=md5($password)"; $qry = \mysqli_prepare($cxn, $stmt); $res = mysqli_execute($qry); db_cxn.php class newconnection{ function __construct(){ $conf = array( "host" => "localhost", "username" => "root", "password" => "root", "dbname" => "db_bookworm", "port" => ini_get("mysqli.default_port"), "socket" => ini_get("mysqli.default_socket"), "prefix" => "bworm_" ); $cxn = new mysqli($conf["host"], $conf["username"], $conf["password"], $conf["dbname"]); ...