Posts

Showing posts from May, 2011

google play services - get current location of android device -

google play services - get current location of android device - i have taken code google " googleplacelocation " project. trying should give me current nearest location of mobile, using longitude , latitude comparing . right giving me list view of close places through when click on place name shows me address, name , longitude , latitude. i'm trying closest nearby location. has other files such googleplaces , place.java , on. work done here. here code mainactivity.java public class mainactivity extends activity { // flag net connection status boolean isinternetpresent = false; // connection detector class connectiondetector cd; // alert dialog manager alertdialogmanager alert = new alertdialogmanager(); // google places googleplaces googleplaces; // places list placeslist nearplaces; // gps location gpstracker gps; // button button btnshowonmap; // progress dialog progressdialog pdia

python - Control output of Django Rest Framework -

python - Control output of Django Rest Framework - my rest api functioning correctly, output id numbers. how can 'role_type' display name instead of id number? output: {"count": 2, "next": null, "previous": null, "results": [{"user": {"username": "smithb", "first_name": "bob", "last_name": "smith"}, "role_type": 2, "item": 1}, {"user": {"username": "jjones", "first_name": "jane", "last_name": "jones"}, "role_type": 2, "item": 1}]} serializers.py class roleserializer(serializers.modelserializer): user = personshortserializer(many=false, read_only=true) class meta: model = role fields = 'user', 'role_type', 'item' def get_role_type(self, obj): homecoming obj.name models.py

java - Lucene search of two or more words not working on Android -

java - Lucene search of two or more words not working on Android - i using lucene 3.6.2 on android. code used , observations made below. indexing code: public void indexbookcontent(book book, file externalfilesdir) throws exception { indexwriter indexwriter = null; niofsdirectory directory = null; directory = new niofsdirectory(new file(externalfilesdir.getpath() + "/indexfile", book.getbookid())); indexwriterconfig indexwriterconfig = new indexwriterconfig(lucene_36, new standardanalyzer(lucene_36)); indexwriter = new indexwriter(directory, indexwriterconfig); document document = createfieldsforcontent(); string pagecontent = html.fromhtml(decryptedpage).tostring(); ((field) document.getfieldable("content")).setvalue(pagecontent); ((field) document.getfieldable("content")).setvalue(pagecontent); ((field) document.getfieldable("content")).setvalue(pagecontent.tolowercase()); } private document

Printing Specific Rows in R -

Printing Specific Rows in R - hi guys working big info frame records employee time card info specific months. want print out entire row of employees record maximum of 3 zeros in 3 different months. believe need utilize apply function: apply(employee, 1, ...) employee name of info frame, 1 allows iterate on each row, unsure how select have 3 or fewer zeros in row. appreciate help! you utilize rowsums() . here's illustration false data. > d <- data.frame(x1 = c(0, 1, 0, 0), x2 = c(0, 2, 2, 0), x3 = c(0, 2, 0, 0), x4 = c(3, 0, 0, 0)) > d # x1 x2 x3 x4 # 1 0 0 0 3 # 2 1 2 2 0 # 3 0 2 0 0 # 4 0 0 0 0 the can subset rows logical value of x == 0 sums 3 or less: > d[rowsums(d == 0, na.rm = true) <= 3, ] # x1 x2 x3 x4 # 1 0 0 0 3 # 2 1 2 2 0 # 3 0 2 0 0 r

nginx - Excluding location path from file pathes -

nginx - Excluding location path from file pathes - in config file, location /i/ { root /data/w3; } the /data/w3/i/top.gif file sent in response /i/top.gif request. how can set ignore i in file paths? indeed need /i/top.gif mapped /data/w3/top.gif . location /i/ { alias /data/w3/; } nginx config httpserver

php - Remove nth element from redis's list in thread safe way -

php - Remove nth element from redis's list in thread safe way - in cron job, wish remove nth element redis's list, in thread safe way during iteration. is possible? may know how can so? i'm looking thread safe way. there author process, perform write operation same list time-to-time. while (true) { // elements "mylist" list. $list = $redis->lrange("mylist", 0, -1); // iterate through "mylist" list. ($n = 0; $n < count($list); ++$n) { if ($list[$n] == "dummy") { // wish remove nth element (with "dummy" value) "mylist" // in thread safe fashion. how? } } } thread safe of import such next situation won't happen cron job find out "dummy" element 5th element, , prepare remove it. writer process inserting additional element head of list, pushes "dummy" element 6th position. cron job removed 5th element list, n

java - What is wrong with my normal calculations? -

java - What is wrong with my normal calculations? - i attempted utilize algorithm described @ opengl - how calculate normals in terrain height grid?. popped in vertex shader , using perlin noise functions test it, , worked charm, when ported java, didn't work well. float nx = 0; float ny = 0; float nz = 0; vector3 p = new vector3(vpx,vpy,vpz); vector3 off = new vector3(1,1,0); float hl = trygetheight(_mempoints2,p.x - off.x,p.z - off.z); float hr = trygetheight(_mempoints2,p.x + off.x,p.z + off.z); float hd = trygetheight(_mempoints2,p.x - off.z,p.z - off.y); float hu = trygetheight(_mempoints2,p.x + off.z,p.z + off.y); nx = hl - hr; ny = hd - hu; nz = 2.0f; vector3 v = new vector3(nx,ny,nz); v = v.nor(); nx = v.x; ny = v.y; nz = v.z; the results algorithm in vertex shader: the results algorithm in buffer setup: (sorry blur, testing depth of field stuff when snapped these.) the results algorithm in vertex shader: normals should not calculated in sha

sql server 2008 - SQL loop through a table and find the next part record -

sql server 2008 - SQL loop through a table and find the next part record - not sure start on one. inheriated table has list of part numbers are active , inactive. if part number inactive, come in next valid part number. if part number active there no next partnumber. want search on part number , find of next part numbers match. basically table looks this. partnumber varchar(20), active varchar(3), nextpartnumber varchar(20). problem not know how many part numbers in chain. here sample of data: 100x no xyz xyz no 45a6 45a6 yes qwer no rt98 rt98 no poul1 poul1 no n9hgt n9hgt no fgh12 fgh12 yes i can write query this, since don't know how many part numbers there are, won't work. select a.partnumber, a.nextpartnumber, b.partnumber, b.nextpartnumber, c.partnumber, c.nextpartnumber tblparttable inner bring together tblparttable b on a.partnumber = b.nextpartnumber inner bring together tblparttable c on b.partnumber = c.nextpar

javascript - jquery resizable not working after page load -

javascript - jquery resizable not working after page load - i have page stores document's body html in localstorage. when page reloads should (and does) set content same place before reload. i'm able drag,sort, , resize until refresh page. after drag , sort go on work, resize fails. i figured out myself without help negative voters. problem how jquery's resizable stored.i had remove added elements on page reload. edit there functionality problem appended tags (created resizable). next saved localstorage body's html: <header> <div id="pgtitle">how much in day?</div> <div id="login">bob</div> <div id="urname"> <div>what name?</div> <input id="name"> <button type="button" id="button">submit</button> </div> </header> <div id="greeting"></div> <br> <div style="po

Java authentication and password changing periodically -

Java authentication and password changing periodically - i have java application , there 2 users can utilize application, , difference between them 1 can utilize printing menu menubar , other 1 cannot his. so this, made 'log in' frame contains user name field , password, , 3 buttons, "connect" "cancel" , 3rd 1 "change password". the problem of course of study lies in lastly one.. application should alter "password" periodically, saying illustration every 3 months user notified, , can through jdialog 3 text fields(old password, new 1 , confirm password) clicking on "change password" button. well here's 'probably stupid' question: how can create application store password , username, notify user, , allow him alter password, without having database? since database ready use, , didn't create , don't have access add together it... by way application desktop app , searched authentication plug

How to reorder array indexes in PHP? -

How to reorder array indexes in PHP? - this question has reply here: php array keys reorder 3 answers i have array follows: array ( [0] => value1 [1] => value2 [2] => value3 [3] => value4 [4] => value5 [5] => value6 ) now somehow need unset specific key array , using unset. allow suppose removed or unset index 1. after removing index have next array: array ( [0] => value1 [2] => value3 [3] => value4 [4] => value5 [5] => value6 ) now when loop on array 1 time again undefined index 1 error. want inquire there way can reorder array 1 time again indexes ordered? , array looks below after deletion followed reordering: array ( [0] => value1 [1] => value3 [2] => value4 [3] => value5 [4

javascript - ExtJS - Saving nested data to .json file -

javascript - ExtJS - Saving nested data to .json file - i created store, i'm loading nested info .json file: var userstore = ext.create('ext.data.store', { model: 'user', storeid:'2013', autoload: true, pagesize: 4, proxy: { type: 'ajax', url: 'data/users.json', reader: { type: 'json', root: 'users', totalproperty: 'total' }, writer: { type: 'json' } } }); to add together new info grid use: var asdfg = ext.getstore(mynewgrid); asdfg.add({lastname: nowa, firstname: nowa2); everything works fine until refreshed page. after lose changes. my model 'user' file: ext.define(

java - Disadvantages of using an event bus to update the interface? -

java - Disadvantages of using an event bus to update the interface? - i have started utilize event bus library otto updating interface (activities) different components in android application. instance, when alter model class made, post event bus or if asynctask has finished, post event event bus in onpostexecute method. so far using 1 event bus user interface updates. noticed paused activities receive these events yet. in documentation states the paused activity not receive user input , cannot execute code. which find controversial, can explain this, code of course of study executed on different thread, still in activity. my question is, usage result in disadvantages? having multiple activies beingness paused, executing events, updating elements of (paused) activities or ignoring them. result in noticeable overhead or can ignore it? is there different approach when 1 wants utilize event bus updating interface? does result in noticeable overhead or c

javascript - Set ajax url with localStorage does not work in Firefox -

javascript - Set ajax url with localStorage does not work in Firefox - i doing little gpx-parser google-maps javascript/jquery. have upload-form user can upload gpx-file. file (the url file) stored in localstorage because need path in file. (see below) <h1>gpx-upload</h1> <input type="file" id="gpxinput" /> <button onclick="localstorage.clear()">clear</button><br /><br /> <div id="success"></div> <script type="text/javascript"> var inputelement = document.getelementbyid("gpxinput"); inputelement.addeventlistener("change", handlefiles, false); function handlefiles() { var filelist = this.files; //create url uploaded file var objecturl = window.url.createobjecturl(filelist[0]); //create local variable localstorage.setitem("gpxurl", objecturl); $( "div#success" ).html('<p>upload

Nagios - Access Forbidden 403 -

Nagios - Access Forbidden 403 - i have seen few question regard, unfortunately not solve problem. please allow me know if have been able run nagios on opensuse on virtual machine. i have open suse installed in 2 different computers. 1 via vmware , 1 via virtualbox , run fine other application. no problem on accessing network etc. but after next open suse installation steps mentioned at: http://nagios.sourceforge.net/docs/nagioscore/4/en/quickstart-opensuse.html i find "access forbidden! error 403" messege when start localhost/nagios (removed http:// purposefully in post) on firefox. installation looks went through fine no error. using opensuse 13.1 version, tried nagios version 4.0.6 , 4.0.7 along plugins 2.0.2. i made sure, apache(apache2), gcc, gcc++, kernel-source (as suggested in nagios forum user), php, apache2-mod_php5, create etc installed. apache2 service running , retasrted after running: create install-webconf the username , password rightly keye

c++ - Should ownership be ended before or after stl containers call its value's destructor? -

c++ - Should ownership be ended before or after stl containers call its value's destructor? - in next code, x registered in global container becomes shared owner of it. destructor of x tests no longer part of such ownership anymore, expect valid precondition getting destroyed. #include <vector> #include <memory> struct x { ~x(); }; std::vector<std::shared_ptr<x> > global_x_reg; x::~x() { (auto iter = global_x_reg.begin(), end = global_x_reg.end(); iter != end; ++iter) if (iter->get() == this) throw "oops. x gets destroyed while still owned!"; } int main(int argc, char** argv) { global_x_reg.push_back( std::shared_ptr<x>(new x) ); global_x_reg.clear(); // calls x::~x(). } when runs (after compilation vs2010), "oops..." thrown when container cleared. questions: is code legal? if not, why not? if so, should throw? should std container implement clear() in such way during

.htaccess rule conflict with previous defined rules -

.htaccess rule conflict with previous defined rules - right have next .htaccess rules: rewriterule ^(.*)/(.*)_([0-9]+)/$ index.php?section_permalink=$1&content_permalink=$2&content_id=$3 [qsa,l] rewriterule ^(.*)/p-([0-9]+)/$ index.php?section_permalink=$1&page=$2 [qsa,l] rewriterule ^(.*)/$ index.php?section_permalink=$1 [qsa,l] everything works fine, if add together next rule, every time seek access /route/10/ (for example) redirected home page. rewriterule ^route/(.*)/$ route.php?route=$1 [qsa,l] how can rewrite rule avoid issue? thank you. rewriterule s executed in order in file. rewriterule ^(.*)/$ index.php?section_permalink=$1 [qsa,l] matches url , url rewritten index.php?section_permalink=route/10 . doesn't match next rewriterule. swapping more specific rule , and more-or-less catch-all rule solve issue, since more specific rule matched first. .htaccess

html - How to add sub menu to Navigation menu -

html - How to add sub menu to Navigation menu - i want design menu, next screen short the menu have designed in next screenshort the html code menu given <div id='cssmenu'> <ul> <li class='active'><a href='index.html'><span>women</span></a></li> <li><a href='#'><span>men</span></a></li> <li><a href='#'><span>junior</span></a></li> <li ><a href='#'><span>accessories</span></a></li> <li><a href='#'><span>collection</span></a></li> <ul> <li><a href="#">item</a></li> <li><a href="#">item</a></li> <li><a href="#">item</a></li> <

sql - Asp.net Unable to Connect to MSSQL -

sql - Asp.net Unable to Connect to MSSQL - when seek launch web project in asp.net mssql, seems cannot connect database. error message is: a network related or instance specific error occurred while establishing connection sql server... but when seek run previous projects, works. however, when select programme -> microsoft sql server 2008 -> configuration tools -> sql server configuration manager -> sql server services. instead of listing services, shows me error remote procedure phone call failed. i wonder how prepare happens 1 of project. in advance. my web.config codes: edit: <?xml version="1.0" encoding="utf-8"?> <!-- more info on how configure asp.net application, please visit http://go.microsoft.com/fwlink/?linkid=169433 --> <configuration> <configsections> <sectiongroup name="applicationsettings" type="system.configuration.applicationsettingsgroup, system, vers

eclipse - How to configure project as android application -

eclipse - How to configure project as android application - while trying solve client endpoint generation problem checked "use google app engine" check box in project, , tho i've unchecked im getting , error saying "project ..... not web-application" also since cannot save changes create project properties, says "an error occured while saving project properties:null" log java.lang.nullpointerexception @ com.google.appengine.eclipse.core.properties.ui.gaeprojectpropertypage.savechangestoappenginewebxml(gaeprojectpropertypage.java:890) @ com.google.appengine.eclipse.core.properties.ui.gaeprojectpropertypage.saveprojectproperties(gaeprojectpropertypage.java:336) @ com.google.gdt.eclipse.core.ui.abstractprojectpropertypage.performok(abstractprojectpropertypage.java:77) @ org.eclipse.jface.preference.preferencedialog$13.run(preferencedialog.java:965) @ org.eclipse.core.runtime.saferunner.run(saferunner.java:42) @ org.eclipse.ui.internal.jfaceut

.net - How to specialize an inherited List to a List in C#? -

.net - How to specialize an inherited List<SuperClass> to a List<SubClass> in C#? - this sounds mutual problem, whats best practice if have base of operations class public property of type list<superclass> , inherit list in class b want utilize more specialized type parameter list: class superclass { public bool flag; } class subclass : superclass { public int number; } class { public list<superclass> elements { get; } } class b : { public list<subclass> elements { get; set; } } so how can in overwrite elements list new list, still create sure accessed if class knows objects? class c { list<a> alist; void filllist() { alist.add(new b()); } void dosomething() { foreach (var in alist) forach(var super in a.elements) super.flag = true; } } you cannot. because stands, if insert superclass through interface, b fail, because superclass

java - (Android) Check if EditText is empty? -

java - (Android) Check if EditText is empty? - this question has reply here: check if edittext empty. 24 answers how check if edittext empty? want create if edittext blank, textview value " " (space). if it's not, resume normal. how go doing this? help! to check edittext empty ,where myedittext edittext if(myedittext.gettext().tostring().trim().length() == 0) or utilize below function private boolean isempty(edittext myedittext) { homecoming myedittext.gettext().tostring().trim().length() == 0; } if function homecoming false means edittext not empty , homecoming true means edittext empty for more info see best link check if edittext empty. java android android-studio

javascript - How to disable value when its chosen once by the user? -

javascript - How to disable value when its chosen once by the user? - i want disable value alternative 1 time user chooses it. for illustration if user chooses (7:00 am) next time go , click on drop-down 1 time again value won't available them choose. best way this? <td> time display (please come in time format hh:mm tt): <td> <select id="time_used" name="time_used" validate="date" > <option selected> select time</option> <option value="7:00 am">7:00 am</option> <option value="7:15 am">7:15 am</option> <option value="7:30 am">7:30 am</option> <option value="7:45 am">7:45 am</option> <option value="8:00 am">8:00 am</option> <option value="8:15 am">8:15 am</option>

ios - Swift: Undefined symbols for architecture i386: "_OBJC_CLASS_$_CGColor" -

ios - Swift: Undefined symbols for architecture i386: "_OBJC_CLASS_$_CGColor" - i'm trying animate background color of view. in animationdidstop delegate method seek set final background color using tovalue property of cabasicanimation object. code seems right in editor when compile project linker doesn't find cgcolor class. code works if omit uicolor(cgcolor: animation.tovalue cgcolor! ) look (for illustration using const uicolor ) class viewcontroller: uiviewcontroller { @ibaction func colorselected(sender: uibutton) { allow animation = cabasicanimation(keypath: "backgroundcolor") animation.tovalue = sender.backgroundcolor.cgcolor animation.delegate = self self.view.layer.addanimation(animation, forkey: "fadeanimation") } @objc override func animationdidstop(anim: caanimation!, finished flag: bool) { allow animation = anim cabasicanimation self.view.backgroundcolor

c# - Determine if a property type is a generic type argument -

c# - Determine if a property type is a generic type argument - say have class: public class genericmodel<t1, t2> { public t1 model1 { get; set; } public t2 model2 { get; set; } } how can tell using reflection type of model1 generic argument t1 , type of model2 generic argument t2? i'm looking property or tell me model1's type maps typeof(genericmodel<,>).getgenericarguments()[0] simple: var model1type = typeof(genericmodel<,>).getproperty("model1").propertytype; var model2type = typeof(genericmodel<,>).getproperty("model2").propertytype; then values of model1type.isgenericparameter & model2type.isgenericparameter both true indicating you've got generic parameter type properties. also, model1type.name == "t1" & model2type.name == "t2" . if have specific instance, such var instance = new genericmodel<int, int>(); , can generic name of property out: var

Oracle SQL: How to select the last available value in a month? -

Oracle SQL: How to select the last available value in a month? - i have series of daily data, though values not available days. , want select lastly value of every month, , match date end day of month. if no observations available month, add together month result , homecoming null. for example, original table is: as_of_date dailyavg 24-oct-13 12.00.00.000000000 71.61 29-oct-13 12.00.00.000000000 59.26 30-oct-13 12.00.00.000000000 57.29 31-oct-13 12.00.00.000000000 55.44 22-nov-13 12.00.00.000000000 0 27-nov-13 12.00.00.000000000 0 29-nov-13 12.00.00.000000000 0 15-jan-14 12.00.00.000000000 195.83 28-jan-14 12.00.00.000000000 537.83 29-jan-14 12.00.00.000000000 519.28 30-jan-14 12.00.00.000000000 501.97 31-jan-14 12.00.00.000000000 485.78 06-feb-14 12.00.00.000000000 119.79 07-feb-14 12.00.00.000000000 79.86 28-feb-14 12.00.00.000000000 588.28 31-mar-14 12.00.00.000000000 2315.56 and want code return: dates monavg 31-oct-13 55.44 30-nov-

Excel Connections in Google Drive -

Excel Connections in Google Drive - i have excel 2010 file (.xlsx) multiple connections import info web. instead of having open file manually , click "refresh all", want utilize google docs (specifically google sheets) automate refresh process every 60 minutes. uploaded xlsx file google drive connections not work anymore. how around this? additional information: 1. info connections kayak flight search service. here's illustration page. importing table info @ top of page shows prices flexible dates. 2. tried using importhtml in google sheets reason doesn't identify above table html table. parse error. i used kimono generate api (you have sign utilize it) can homecoming csv of form: "collection1" "depart-sat.text","depart-sat.href" "$798","javascript: filterlist.flexfiltertodates('20141213', '20150111', 798)" "$798","javascript: filterlist.flexfiltertodates('2

node.js - Yo Webapp: Error EACCES, permission denied 'Gruntfile.js' -

node.js - Yo Webapp: Error EACCES, permission denied 'Gruntfile.js' - i trying install yeoman generator , always error eaccess, permission denied, since switched linux. fs.js:432 homecoming binding.open(pathmodule._makelong(path), stringtoflags(flags), mode); ^ error: eacces, permission denied 'gruntfile.js' @ object.fs.opensync (fs.js:432:18) @ object.fs.writefilesync (fs.js:971:15) @ appgenerator.<anonymous> (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/actions/actions.js:217:10) @ processimmediate [as _immediatecallback] (timers.js:336:15) i running node v0.10.29 , npm v1.4.14 , zorin os8 codename saucy. if install "yo webapp-gulp" error message says: "eacces, permission denied 'gulpfile.js' i know "error eacces" here, , read of lot threats, nil fitted yet. give thanks much. edit: bower won't work, because message, if want install package

c# - System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first -

c# - System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first - i making webmethod in asmx.... whenever run method error... want add together manually row in dataset,with help of datareader [webmethod] public dataset newleger(string accno, string fromdate, string todate) { sqlconnection con = new sqlconnection(@"data source=123-pc;initial catalog=bcounts;persist security info=true;user id=saba;password=123"); con.open(); sqlcommand cmd = new sqlcommand("select gt.value_date,gt.voucher_no+'-'+gr.vchrtype voucher,gt.acct_nirration,gr.instrumentno,gt.dr_amount,gt.cr_amount gl_transaction gt, gl_ref gr gt.accountno = '" + accno + "' , gt.voucher_no=gr.voucher_no , gt.value_date between '" + fromdate + "' , '" + todate + "'", con); sqldataadapter adp = new sqldataadapter(cmd); sqlda

oracle - Should I commit after each SQL action, or do multiple actions and then commit? Which is more efficient? -

oracle - Should I commit after each SQL action, or do multiple actions and then commit? Which is more efficient? - i need clarification on sql scenario of sql commits. for example: 1) delete tablename column_name = 'value'; commit above transaction; versus 2) (i...n){ delete tablename column_name ('value'); } commit after 'n' transactions.. consider n >=10, in case stress on db improve compared 1st approach or 2nd approach have same effect 1st approach... know best approach pass multiple values in clause... need know if 2nd improve 1st one>? committing every n transactions indeed faster , nicer database logging facilities. trade-off how much info willing lose if have restart process. e.g., have 10,000,000 batch rows load. if process crashes @ row number 7,543,232, how many rows can afford have load again? and yes, you'd prepare statement bind parameters (? marks

java - Reverting a custom view -

java - Reverting a custom view - i working on app utilizes custom view,mainview.java extends view, setting view mainactivity on onclick using: public void onclick(view view) { if(view.getid() == r.id.button){ mainview = new mainview(this); setcontentview(mainview); mainview.setbackgroundcolor(color.black); } } the mainview runs game , if player "loses" want screen homecoming showing initial activity_main.xml, or other suitable view. observe loss in mainview's update() method. private void update() { if(lives == 0){ reset(); } if(score >= lvlscore){ levelup(); } for(projectile proj: balls) {//set positions balls proj.setposition(); } for(projectile proj: badballs){//set positions bad balls proj.setposition(); } what have been unable figure out retrieve info mainview in activity, score, , how revert cus

function - PHP - Variable Scope Confusion -

function - PHP - Variable Scope Confusion - this question has reply here: reference: variable scope, variables accessible , “undefined variable” errors? 2 answers i know crazy basic, little confused situation. may because mixing logic other languages bare me. while($row = $stmt->fetch(pdo::fetch_assoc)) { $un = $row['username']; $pw = $row['passwrd']; $at = $row['account_type']; $globals['fn'] = $row['fname']; } so code within function. variables $un , $pw , $at declared , given value within block of code. now understanding variables declared in block of code able used in block. as can see have $globals['fn'] variable setup utilize in other file makes sense me create global. now question is: how possible reference variable outside of code block when decl

javascript - Copy XREExeF and paste as file shortcut -

javascript - Copy XREExeF and paste as file shortcut - in addon launching firefox profiles doing this: var exe = fileutils.getfile('xreexef', []); //this gives path executable var process = cc['@mozilla.org/process/util;1'].createinstance(ci.nsiprocess); process.init(exe); var args = ['-p', profname, '-no-remote']; //-new-instance if (url) { args.push('about:home'); args.push(url); } process.run(false, args, args.length); so adds command line arguments , launches it. leads problems. users want pin icon , pins firefox.exe . users seek alter icon. wikipedia says os back upwards shortcuts: http://en.wikipedia.org/wiki/file_shortcut so wanted re-create xreexef , paste shortcut , add together command line arguments it. edit: @nmaier know there no cross-os method. can please show me os specific methods. no, there no cross-platform way create shortcuts. in fact there not cross-browser format shortcuts, the wikipe

r - How to deal with "non-conformable" arrays? -

r - How to deal with "non-conformable" arrays? - how 1 element-wise arithmetic operations 2 arrays conformable in first dimensions 1 has dimension? example, multiply array a (3 x 3 x 2) array b (3 x 3): a <- array(1:18, dim=c(3,3,2)) b <- diag(3) the next fails because arrays non-conformable. > * b for work, have cast array b array right number of dimensions. > * array(b, dim=c(3,3,2)) this doesn't strike me beingness straightforward , i'm sure there must simpler way. you can try: a * c(b) c strip attributes, allow recycling of b simple vector , lead believe desired outcome: , , 1 [,1] [,2] [,3] [1,] 1 0 0 [2,] 0 5 0 [3,] 0 0 9 , , 2 [,1] [,2] [,3] [1,] 10 0 0 [2,] 0 14 0 [3,] 0 0 18 arrays r multidimensional-array

c# - finding string between two specified characters in Sql -

c# - finding string between two specified characters in Sql - i have linkedin link in database column here have check linkedin id linked in link inserted 2 or more times. ex:https://www.linkedin.com/profile/view?id=246925795&authtype=name&authtoken=sygl&trk=prof-sb-browse_map-name i have check id in database if id repeats 2 or more times must deleted , 1 must left. id=246925795 please help me with ids ( select id, substring(linkedinlink, idstart, idend - idstart) linkedinid table cross apply ( select charindex('id=', linkedinlink) idstart ) ca1 cross apply ( select charindex('&', linkedinlink, idstart) idend ) ca2 ) ,duplicates ( select linkedinid ,max(id) lastduplicateid ids grouping linkedinid having count(*) > 1 ) delete table id in (select lastduplicateid duplicates) c# asp.net sql sql-server sql-server-2008