Posts

Showing posts from May, 2013

leiningen - clojure lein (read-line) stdin woes -

leiningen - clojure lein (read-line) stdin woes - so regular clojure repl works fine, (read-line) collects input, echos it. using lein repl though, never echoes input characters, nor ever allows me homecoming stdin reading commands. i'm sure has rebinding in, wondering if there workaround/fix? thanks. this due bug in ant; prevents stdin stream subprocess launches beingness used. telnet trick should work since lein repl launches socket repl server; works fine here. clojure leiningen

geometry - Define a function for a circle caps the end of a line segment -

geometry - Define a function for a circle caps the end of a line segment - i need function returns points on circle in 3 dimensions. the circle should "cap" line segment defined points , b , it's radius. each cap perpendicular line segment. , centered @ 1 of endpoints. here shitty diagram let n unit vector in direction b, i.e., n = (b-a) / length(a-b). first step find 2 more vectors x , y such {n, x, y} form basis. means want 2 more vectors pairs of {n, x, y} perpendicular each other , unit vectors. way think want create new coordinate scheme x-axis lines line segment. need find vectors pointing in direction of y-axis , z-axis. note there infinitely many choices x , y. need somehow find 2 work. one way first find vectors {n, w, v} n above , w , v 2 of (1,0,0), (0,1,0), , (0,0,1). pick 2 vectors w , v correspond smallest coordinates of n. if n = (.31, .95, 0) pick (1,0,0) , (0,0,1) w , v. (math geek note: way of picking w , v ensures {n,w,v} spans ...

jquery - Call a function with parameter, opens a modal dialog and send the content via ajax -

jquery - Call a function with parameter, opens a modal dialog and send the content via ajax - i have datalist ids deleted, want inquire first why beingness deleted, using modal dialog. that, there piece of code repeats according number of records returned: <asp:imagebutton runat="server" id="deleteimagebutton" imageurl="~/images/delete.png" tooltip="baixar item!" onclientclick='<%# string.format("postdelete(\"{0}\")", eval("orcid")) %>' /> and here code process it: function postdelete(temporcid) { $.ajax({ type: "get", url: "baixar_teste.aspx", data: { paramorcid: temporcid, reasontext: $("#reasontext").val() } }); }; it works perfectly. however show ui dialog when user clicks image in 'asp' code above. then, modal dialog show , capture parameter 'reasontext' code below, , fi...

ORACLE SQL it is possible to customize the order result of a query? -

ORACLE SQL it is possible to customize the order result of a query? - i have case in need order query result in customized order next : the departement_id needs in order ( 10 50 20 ) is there way result ? you utilize case look in order by clause. i answered similar question here, http://stackoverflow.com/a/26033176/3989608, tweak have customized conditions in case expression. for example, sql> select ename, 2 deptno 3 emp 4 order 5 case deptno 6 when 20 1 7 when 10 2 8 when 30 3 9 end 10 / ename deptno ---------- ---------- smith 20 ford 20 adams 20 jones 20 scott 20 clark 10 king 10 miller 10 allen 30 turner 30 ward 30 martin 30 james 30 blake 30 14 ro...

c# - Form Font Embedding -

c# - Form Font Embedding - it's while i'm trying figure out what's happening in piece of code. [system.runtime.interopservices.dllimport("gdi32.dll")] private static extern intptr addfontmemresourceex(intptr pbfont, uint cbfont, intptr pdv, [system.runtime.interopservices.in] ref uint pcfonts); public static privatefontcollection myfontcollection = new privatefontcollection(); public static fontfamily robotobold = null; public static fontfamily robotothin = null; public enum fonts { roboto_bold = 0, roboto_thin = 1 } public static void loadfonts() { array fonts = enum.getvalues(typeof(fonts)); foreach (fonts font in fonts) { byte[] fontdata = (byte[])resources.resourcemanager.getobject(font.tostring()); intptr fontptr = system.runtime.interopservices.marshal.alloccotaskmem(fontdata.length); system.runtime.interopservices.marshal.copy(fontdata, 0, fontptr, fontdata.length); uint dummy = 0; myfontc...

HighCharts ColumnRange with series in fixed position at bottom of the chart -

HighCharts ColumnRange with series in fixed position at bottom of the chart - i have created inverted columnrange chart working visualize series time-range based events. jsfiddle here the problem i'm running want of series (dark , lite blue) distribute throughout chart, want 1 of series (green) running along bottom of chart only. in illustration above, tried force series bottom pointplacement of -.5, not positioned way @ bottom of chart like. i tried create 2 x-axis categories (see below). hope able have 1 of categories (the top one) take of chart, categories distribute evenly on y-axis lower (green) line takes more space needs to. any help on how solve problem appreciated. thanks, dave highcharts

c++ - What is an acceptable MIDI bandwidth over USB? -

c++ - What is an acceptable MIDI bandwidth over USB? - i working on midi effect (a vst plugin modifies incoming midi generates new info , forwards out) using juce framework in c++. see it's technically possible generate new midi message every sample making stream of midi flow @ 16 24 bits 41,000 times sec or more. seems exclusively impossible midi hardware handle. is there guideline or rule must adhere when when decide on bandwidth midi on usb hardware synths, new , old? edit: should add together trying do, higher bandwidth help, should work hardware such arturia minibrute. attempting novel things apply envelopes , lfos modulation , pitch wheel. midi on din cables runs @ 31250 bits/s, i.e., 3125 bytes/s. the usb midi specification not specifiy bandwidth, underlying usb mass transfer protocol implicitly allows receiving device decide when take new packets. in other words, usb midi device can decide how fast runs, there no easy mechanism determine limit (espe...

Robocopy appears to do nothing when /MT flag is used -

Robocopy appears to do nothing when /MT flag is used - this command works: robocopy \\build7\d$ d: *.* /mir /xd "system volume information" /xd "$recycle.bin" but when seek adding /mt flag: robocopy \\build7\d$ d: *.* /mir /xd "system volume information" /xd "$recycle.bin" /mt the output ------------------------------------------------------------------------------- robocopy :: robust file re-create windows ------------------------------------------------------------------------------- started : thu apr 09 09:11:27 2015 source : \\build7\d$\ dest : d:\ files : *.* exc dirs : scheme volume info $recycle.bin options : *.* /s /e /copy:dat /purge /mir /mt:8 /r:1000000 /w:30 ------------------------------------------------------------------------------ it gives me output, , sits there. i tried using /log flag redirect output file, still sat there same output, in file. ...

vb.net - CameraCaptureUI Save picture at specified location -

vb.net - CameraCaptureUI Save picture at specified location - i using cameracaptureui api take image on windows tablet. can take picture, have no thought saved or how alter it's save folder. i have tried doing next code save in image library without success : dim filecopy storagefile = await file.copyasync(knownfolders.pictureslibrary, "mynicephoto.bmp", namecollisionoption.replaceexisting) here code utilize take image (taken cameracaptureui sample) private appsettings windows.foundation.collections.ipropertyset private const photokey string = "capturedphoto" seek ' using windows.media.capture.cameracaptureui api capture photo dim dialog new cameracaptureui() dim aspectratio new size(16, 9) dialog.photosettings.croppedaspectratio = aspectratio dim file storagefile = await dialog.capturefileasync(cameracaptureuimode.photo) if file isnot nil dim bitmapimage new bitmapimage() using filestream ir...

excel - Result from formula is incorrect due to more than 255 characters -

excel - Result from formula is incorrect due to more than 255 characters - hope can explain properly. below formula homecoming info lastly (not latest) entered in column: =index(a:a,match(rept("z",255),a:a)) instead of returning lastly value, returns sec lastly value. assume has cell containing more 255 characters. is there way around it? thought changing "255" "350" prepare issue (clearly returned error). cheers mal if want value in lastly occupied cell not use: =index(a:a, counta(a:a), 1) excel formula

regex - Adding space after symbol if there doesn't already exist a space? -

regex - Adding space after symbol if there doesn't already exist a space? - i need replace instances of commas in file there isn't space after comma. for example, next needs change. this: some function(int x,int y, int z) { // code } to this: some function(int x, int y, int z) { // code } notice spaces after commas there wasn't space. how can apply 1,000+ line file of code using sublime? use ctrl + h open search , replace, enable regular expression.. using negative lookahead: find: ,(?!\s) replace: , ^ |___ space character or basic regular expression: find: ,([^\s]) replace: , \1 regex sublimetext2 sublimetext sublimetext3

C getting input from CMD -

C getting input from CMD - how input using prompt? tried compiling code bellow "a.exe" , executing cmd "gcc a.exe 5", doesn't output number supposed to. #include <stdio.h> int main(int a) { printf("%d\n", a); homecoming 1; } have done wrong when installing compiler or trying run wrong? your main() parameters wrong, should way: int main(int argc, char **argv) { if(argc > 2) { printf("%s\n", argv[2]); } else { printf("no arguments\n"); } } note int argc represents number of parameters , char **argv array containing parameters, strings, including "gcc", "a.exe", etc. in case, if run programme way: gcc a.exe 5 , parameters be: argc = 3, argv = ["gcc", "a.exe", "5"] c

sql - Inserting results of two sums together to a table -

sql - Inserting results of two sums together to a table - from previous question, i've managed things work using microsoft sql server , importing excel file new database. now, question dealing writing right sql commands. i'm trying sum same column of table twice using different criteria, , input numbers different table. know how insert sum table, wonder how can insert 2 sums came same column simultaneously (since each time insert, new row created) same row of table. additional question: way should organize results dependent on values 3rd table? sample info follows. some sample data: deptid section 15 eng 16 eng 17 mkt 18 mkt | person | deptid | type | number | +--------+------------+------+---------+ | | 15 | p1 | 1 | | b | 18 | p2 | 5 | | c | 16 | p2 | 10 | | d | 17 | p1 | 7 | | e | 18 | p1 | 11 | | f | ...

mysql - Easiest way for PHP email verification link -

mysql - Easiest way for PHP email verification link - i have advanced user login/register scheme on website (colemansystems.psm2.co.uk). however, have email sent new users verification of email address. if have not clicked link not able access account. semi-experienced php , mysql, please explain in depth. edit: code i'm using verify.php file (the link user click on (for example, verify.php?d=51773199320 )) $secret = $_get['d']; $result = mysql_query("select valid users secret=$secret"); while ($row = mysql_fetch_array($result)) { $valid = $row['valid']; } if ($valid == "") { echo"there seems problem verification code.<br><br><br><br><br>"; } elseif ($valid == "1") { echo"your business relationship verified.<br><br><br><br><br>"; } else { mysql_query("update users set valid = '1' secret=$secret"); echo ...

iphone - OpenFeint is on only half of the screen -

iphone - OpenFeint is on only half of the screen - i'm trying implement openfeint in cocos2d iphone game, here's weird didn't find how solve. here's how openfeint looks when initialize it: http://img842.imageshack.us/img842/8564/screenshot20100926at520.png , here's code of initialization: [director setdeviceorientation:kccdeviceorientationlandscapeleft]; nsdictionary* settings = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithint:uiinterfaceorientationlandscapeleft], openfeintsettingdashboardorientation, @"name", openfeintsettingshortdisplayname, [nsnumber numberwithbool:no], openfeintsettingenablepushnotifications, [nsnumber numberwithbool:yes], openfeintsettingalwaysaskforapprovalindebug, [nsnumber numberwithbool:yes], openfeintsettingdisableusergeneratedcontent, nil]; [openfeint initializewithproductk...

jquery - how can i stop video from playing if not point view -

jquery - how can i stop video from playing if not point view - js play videos in site but wanna stop playing video if not in view point i create code $(document).on("scroll", function() { var scrolltop = $(window).scrolltop(); $( "video" ).each(function() { var pos = index.position(); if (scrolltop < pos.top + 100) { $(this)[0].play(); } if (scrolltop > pos.top + 400) { $(this)[0].stop(); } if (scrolltop < pos.top - 400) { $(this)[0].stop(); } }); }); but not work me , not show error this demo page "http://jsbin.com/yaqozihita/1/" you can utilize code observe if element in view or not. iterate each video element, if isinview() true, start video, if not pause if not paused already. caveats: need create sure video has loaded @ to the lowest degree metadata or video element may cause errors. utilize preload="auto" , canplay ev...

ios - How to create a button with rubber or jelly kind animation -

ios - How to create a button with rubber or jelly kind animation - i need create button animation "when press on point of button, should pressed rubber or jelly , after few while, come own before position own". i had searched every possible place, didn't need. if 1 had did before or have suggestion on it, please share. thanks in advance. what can have 2 different images button. 1 without jelly effect, with. create method touchdown set button's image jelly one, method touchupinside set original (alongside else pressing button does). ios iphone xcode

Caesar Cipher java my way, doesnt work -

Caesar Cipher java my way, doesnt work - i know there bunch of topics caesar cipher solve things way. , such doesnt work ,but think help might work way.i sure know feeling when lone solve problem. so here idea. create array of chars consist alphabet. , string message code. 2 loops. 1 outer set char message, , inner scans thru alphabet array. when letter message meet char in array, replaces him 3rd (key of 3) char downwards in array. here piece of code written now: char[] alphabet = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p','r','s','t','u', 'v', 'z'}; string message = " message coding"; message = message.tolowercase(); string codedmsg = ""; for(int = 0; < message.length(); i++) { for(int j =0; j < alphabet.le...

javascript - Returning a serverside datatable to client with google App Script -

javascript - Returning a serverside datatable to client with google App Script - i want homecoming datatable created in google apps script info spreadsheet client. utilize succeshandler info , utilize create chart. problem have info null. seems can't homecoming datatable object client page. i need send client, because google apps script deprecating uiapp functions need google.visualization functions in client. code.gs function doget() { homecoming htmlservice.createhtmloutputfromfile('index.html') .setsandboxmode(htmlservice.sandboxmode.iframe);} function getdatatable() { var bestanden = driveapp.searchfiles('title contains "' + "kwalrap" + '"'); while (bestanden.hasnext()) { var bestand = bestanden.next(); var docid = ( bestand.getid() ); logger.log(docid); }; var sheets= spreadsheetapp.openbyid(docid).getsheets(); //vanaf sheet 0. tot hij bij de laatset sheet is. dan steeds 2 shee...

timeout - Cancel build in drone.io -

timeout - Cancel build in drone.io - i'm working on setting drone.io repositories of team, in order have continuous integration. the problem have test build locked , see no way cancel it. there way cancel manually? if not, there timeout causes build expire? thank you. a running build can canceled manually time via link/button on status page. there 15 min. fixed timeout on free plans (see limits: http://docs.drone.io/buildscript.html). timeout continuous-integration cancellation drone drone.io

java - Pass multiple arguments to javascript function from JSP scriptlet out.println -

java - Pass multiple arguments to javascript function from JSP scriptlet out.println - out.println("<button type='button' class='button' onclick='addprogressgoal(" + g.getgoalprogress() + g.getgoalid() + g.gettargetvalue() + ")'>add progress</button>"); how can pass 3 seperate values in addprogressgoal using + sending across 1 value of g.getgoalprogress(), g.getgoalid() , g.gettargetvalue() added together. here function: function addprogressgoal(progress, id, target) { for reason cannot seem send 3 across in valid code is want ? out.println("<button type='button' class='button' onclick='addprogressgoal(" + g.getgoalprogress() +", "+ g.getgoalid() +", "+ g.gettargetvalue() + ")'>add progress</button>"); commas between parameters ? java javascript jsp scriptlet

sql - Differences between forms of LEFT JOIN -

sql - Differences between forms of LEFT JOIN - what difference between these query class="lang-sql prettyprint-override"> select a.anyfield left bring together b on b.aid = a.id left bring together c on b.cid = c.id and query class="lang-sql prettyprint-override"> select a.anyfield left bring together ( b bring together c on b.cid = c.id ) on b.aid = a.id original answer: they not same. for illustration a left bring together b left bring together c homecoming rows, plus b rows if there no c rows. a left bring together (b bring together c) never homecoming b rows if there no c rows. added later: sql>create table (id int); sql>create table b (id int); sql>create table c (id int); sql>insert values (1); sql>insert values (2); sql>insert b values (1); sql>insert b values (1); sql>insert c values (2); sql>insert c values (2); sql>inser...

python 3.x - Detail information about executed program [PYCharm] -

python 3.x - Detail information about executed program [PYCharm] - i see detailed info memory usage, execution time etc. of programme create in pycharm. is there way view this? maybe there other programme give me info *.py files? python-3.x memory-management time pycharm

Python/Pygame: All Instances Still On Screen After Restart -

Python/Pygame: All Instances Still On Screen After Restart - i'm working on side-scrolling shooter in python , pygame. @ origin of play, create bunch of lists such enemies[] , shots[]. when game restarts, have tried can think of, instances still on screen lastly playthrough! in restart code have this... for item in enemies: enemies.remove(item) del item item in shots: shots.remove(item) del item i have added code after reinitialize list, so: enemies=[] shots=[] but on new playthrough still there. help! your main problem lists exist in more 1 context (another method or function) when enemies = [] clear local variable named "enemies" - ceases point previous object, used in funtcion/method (although don't list code here). your other approach, using for tries iterate on list while modifying - should (and does) break in unexpected ways. simply do: enemies[:] = [] shots[:] = [] instead: these alter object reference...

javascript - How to pause and resume jquery interval -

javascript - How to pause and resume jquery interval - i have made custom slider jquery. have used setinterval function: timer = setinterval(function() {}, 8000); but cannot pause , resume interval. have 2 buttons (play, pause) want utilize for. lets click pause after 3 sec, , resume it. should remain in slider 5 more seconds , go next 1 , go on 8 seconds each. have seen kinda slider mouseover pause, can't myself. have tried this: clearinterval(timer); but seems reset interval, don't pause. can help :) in advance. i'm not exclusively sure that's native jquery, however, utilize flag pause it, , check in setinterval whether execute. edit: found might useful you, the jquery-timer alternitively, can maintain track of id set setinterval, , clear out out when you'd pause. can set 1 time again when wish resume: var id = window.setinterval(<code>); //create window.clearinterval(id); //pause id = window.setinterval(<code>);...

objective c - How to get which UITableViewCell selected without using UITableViewDelegate methods in iOS -

objective c - How to get which UITableViewCell selected without using UITableViewDelegate methods in iOS - i want know how selected cell's row index on selection of cell. how without using uitableviewdelegate methods. please tell me. have search lot not getting solution please if know tell me. please shared viewpoints regarding it. thanks in advance...!!! get selected index path table: nsindexpath *path = [tableview indexpathforselectedrow]; ios objective-c uitableview delegates

scala - How to maintain an immutable list when you impact object linked to each other into this list -

scala - How to maintain an immutable list when you impact object linked to each other into this list - i'm trying code fast non dominated sorting algorithm (nds) of deb used in nsga2 in immutable way using scala. but problem seems more hard think, simplify here problem create mwe. imagine population of seq[a] , , each a element decorateda list contains pointers other elements of population seq[a] . a function evala(a:decorateda) take list of linkeda contains, , decrement value of each. next take subset list decoratedapopulation of population a, , phone call evala on each. have problem, because between each iteration on element on subset list decoratedapopulation , need update population of a new decorateda , new updated linkeda contain ... more problematic, each element of population need update of 'linkeda' replace linked element if alter ... hum can see, seem complicated maintain linked list synchronized in way. propose solution bottom, ...

java - Json Data on Fragment -

java - Json Data on Fragment - i learning android programming , created basic project using android studio. my application crashes when click on getdata button. the mainactivity.java: package com.cs_infotech.newpathshala; import android.app.activity; import android.app.fragmenttransaction; import android.content.intent; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.content.context; import android.os.build; import android.os.bundle; import android.view.gravity; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.support.v4.widget.drawerlayout; import android.widget.arrayadapter; import android.widget.textview; import android.widget.toast; public class mainactivity extends actionbaractivity implements navigatio...

javascript - How to handle a get request with node.js (express) -

javascript - How to handle a get request with node.js (express) - i'm node.js newbie , i'm creating first big app (i'm using express). need have webpage perform javascript canvas-drawing when user loads id request, e.g. www.mywebsite.com/page?id=22 i know can handle simple var express = require("express"); var app = express(); app.get('handle',function(request,response){ //request.id }); but don't know how start webpage asked drawing id. every tutorial on net on express , explains how handle requests... question "what happens next?" rephrased: i'm not sure how should tell html page "you need draw associated id" express , send page user. you can take id params , after homecoming response based on id. var express = require('express'); var app = express(); app.get("/page/:id",function(request, response){ var id = request.params.id; // id...

javascript - Pure JS - display:block not working -

javascript - Pure JS - display:block not working - i know has been asked 1000000 times swear, checked 20 posts , nil works... this code: when utilize clicks on "email" option, input element id of "email" should show underneath it. html <select> <option selected disabled>contact me by:</option> <option onclick="showinput()">email</option> </select> <input class="email" id="email" placeholder="email address" type="text" /> js class="lang-js prettyprint-override"> function showinput() { document.getelementbyid("email").style.display = "block"; } css class="lang-css prettyprint-override"> input#email { display: none; } could explain me how not working? have link js file before body closing tag. use onchange event , move event handler <select> element. added value attrib...

ansible ssh permision denied -

ansible ssh permision denied - i'm generated ssh key, , re-create remote server. when seek ssh server works fine: ssh user@ip_address user not root. if seek ssh throw ansible: ansible-playbook -i hosts playbook.yml with ansible playbook: --- - hosts: web remote_user: user tasks: - name: test connection ping: and hosts file: [web] 192.168.0.103 i got error: ... permission denied (publickey,password) what's problem? ansible using different key compared using connect 'web' machine. you can explicitly configure ansible utilize specific private key private_key_file=/path/to/key_rsa as mentioned in the docs create sure authorize key ansible uses, remote user in remote machine ssh-copy-id -i /path/to/key_rsa.pub user@webmachine_ip_address ssh ansible ssh-keys ansible-playbook

javascript - How to load modal content via ajax bootstrap pagination without reloading main page? -

javascript - How to load modal content via ajax bootstrap pagination without reloading main page? - i have used bootstrap modal , paginate modal content pagination. everytime click next/prev button, entire page (includes main window) gets loaded scripting lines: $("#ajax_process_page").html("<%= escape_javascript(render('/modal_file')) %>"); $(document).ready(function() { $(document).on("click", ".pagination a", function() { $(".pagination").html("<img src='/images/feed-loader.gif' align='middle' />"); $.getscript(this.href); }); }); html code: <div id="ajax_process_page"> <% render "/modal_file" %> </div> we'll need more info help you, however, can seek somethings. looks clicking on link. maybe that's why keeps reloading. if that's case, can prepare using event.preventdefault(), code below: $(do...

c# - Can I 'rename' an external exception class? -

c# - Can I 'rename' an external exception class? - this question has reply here: how alias class name in c#? 9 answers i'm using external sdk wants me use try { ... } grab (ex20301exception) { ... } i'd rather use try { ... } grab (customerovercreditlimitexception) { ... } is there way can accomplish this? or have live comments? possible duplicate of how alias class name in c#? in usings... using customerovercreditlimitexception = the.fully.qualified.namespace.ex20301exception; c#

c# - How to formulate Regular expression for given example -

c# - How to formulate Regular expression for given example - i'm not versed regular expressions. i've had utilize them, maybe 1 time every few years, , course of study work. anyways, next question should straight forwards question/answer familiar regular expressions. i need ensure text entered field follows next format: x y z or x,y,z or x y z / <same pattern can repeat unlimited length> or x,y,z / <...> // spaces after comma ok where x, y , z can integers. patterns cannot intermixed, cannot have x, y, z / x y z / ... i've tried following ([1-9] [1-9] [1-9]) to x y z part, don't know how include '/' nor ',' any suggestions? i guess can use regex r = new regex("^([0-9]+([ ,]|, )[0-9]+(\\2)[0-9]+)( [/] ([0-9]+(\\2)[0-9]+(\\2)[0-9]+)+)*$"); var x1 = r.ismatch("1,2 3"); // false var x2 = r.ismatch("1 3 2 / 1 2 3"); // true var x3 = r.ismatch(...

memory - Concept of register variables(datatype:register) in C language? -

memory - Concept of register variables(datatype:register) in C language? - i want thought how register variables handled in c programme executables. ie in location(or register) stored in case of embedded scheme , in x86 machine(c programme executable in desktop pc)? what view? (correct me if wrong) suppose have declared/initialized 1 variable within function 'int' datatype. go stack segment , there in section @ run time ,when caller calls callee containing local variable. if declare above local variable 'register int' it'll go stack segment. on run time , processor set local variable stack general purpose register locations(because of compiler inserted code due 'register' keyword) , fast access of same there. that difference between them @ run time access , there no memory loading differences between them. __kanu the register keyword in c (rarely ever seen anymore) hint compiler may useful maintain variable in register faster ac...

javascript - How to reload script tag -

javascript - How to reload script tag - i'm dynamically changing script tag's src attribute using javascript. problem is, i'd "undo" previous javascript before re-executing it. way this? thanks, g3 i can describe method used accomplish partial undo in project. ugly, might useful. first, may need refactor script work within iframe, and/or wrap in with statement give easy access objects in parent (don't think of with(opener) ; you'll want more precise with({someobject: opener.someobject}) . when script runs, can utilize iframe's global scope , dom freely. then, instead of reloading <script> tag, overwrite whole iframe, reset script did within iframe. javascript polymer web-component

php - laravel How to select articles with current language? -

php - laravel How to select articles with current language? - i'm new laravel , downloaded starter site here, https://github.com/mrakodol/laravel-5-bootstrap-3-starter-site the site save language in table includes id, lang_code (e.g en), , article database has column "language_id" seems used filtering language. in homecontroller, see line: $articles = article::with('author')->orderby('position', 'desc')->orderby('created_at', 'desc')->limit(4)->get(); this line select articles , print out without language filter. how can select article in current language? you can utilize where filtering columns. of course of study depends on kind of id's given languages. need check db. $articles = article::with('author')->where('language_id',1)->orderby('position', 'desc')->orderby('created_at', 'desc')->limit(4)->get(); php laravel