Posts

Showing posts from March, 2011

symlink - error while creating symbolic links in linux -

i trying create symbolic link ( soft link ) folder lies on remote machine on network. command: ln -s /abc/folder1 folder1 the links not created. when ssh remote machine using... ssh <user>@<remote machine> i able view folder want create symlink when try cd folder machine... not there. i have checked permissions of file on remote machine its: drwxr-xr-x please, can 1 me in understanding problem , how resolve it...

javascript - drag tail(arrow) of Speech bubble on div border -

i creating speech bubble , want drag tip of speech bubble around corner of bubble mouse. should rotate automatically depending on side on. tail moving must in direction mean should draggable side of divs 1 side , must on mouse drag..so can drag tail using mouse ever want bt should across border only..plz give solution. it speech bubble css:- .speechbubble { position: absolute; background: red; border: 1px solid #f2f2f2; opacity: 0.9; top: 58px; left: 18px; width: 153px; height: 40px; min-width: 47px; min-height: 38px; position: absolute; } .speechbubble:after, .speechbubble:before { top: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; ...

datatable - Adding the column result of a DataRow[] column to a variable c# -

i want return value of datarow[] string in c# here datatable : datatable table = new datatable(); table.columns.add("id", typeof(int)); table.columns.add("bugdescription", typeof(string)); table.columns.add("unitprice", typeof(double)); table.rows.add(1, "bug 1", 10.00); table.rows.add(2, "bug 2", 20.00); i create datarow[] called result stores row id = 1: datarow[] result = table.select("id = 1"); the last step want achieve add bugdescription value string named description . how achieve this? your code datarow[] result = table.select("id = 1"); tells you have got array of datarows. means may have more 1 record here. so, depends on row assign. can if think first one if(result.length > 0) { string description = convert.tostring(result[0]["bugdescription"]); } doing linq way string description = table.row...

joomla2.5 - Joomla tooltip not hiding -

my problem tooltips not hiding after cursor moved away text tooltip. can check page example of problem: http://federationgenealogie.qc.ca/nous-contacter (which simple com_contacts page) but problem persists throughout website. i've tried template override of com_contacts , change way tool-tips handled using: http://docs.joomla.org/how_to_add_tooltips_to_your_joomla!_website $tooltiparray = array('classname' => 'mytooltipclass', 'showdelay'=>'500', 'hidedelay'=>'500', 'fixed'=>true, 'onshow'=>"function(tip) {tip.effect('opacity', {duration: 500, wait: false}).start(0,1)}", 'onhide'=>"function(tip) {tip.effect('opacity', {duration: 500, wait: false}).start(1,0)}"); jhtml::_('behavior.tooltip', '.hastip', $tooltiparray); ?> only 'fixed'=>true parameter works, feeling kind of works. since other parameters not ...

add reply to a comment system that using jquery and php -

i trying create commenting system uses facebook. use php , jquery. code works perfect. want add reply system in it. idea how this? this main page: wall.php <script> $(document).ready(function(){ $("#comment_process").click(function(){ if($("#comment_text").val() != ""){ $.post("comments.php?action=post", { comment: $("#comment_text").val() }, function(data) { $(".comments").html(data); $("#comment_text").val(""); }); } }); }); </script> <div class="comment_container"> <div class="comment_form"> <textarea id="comment_text" ></textarea> <input type="button" id="comment_process" value="post"/> </div> </div> <div class="comments"> <?php include_once("comments.php");?> </div...

loops - PHP foreach with two 'as'? -

hi there trying combine 2 loops of foreach have problem. the problem <a href='$link'> same results must different. here code using: <?php $feed = file_get_contents('http://grabo.bg/rss/?city=&affid=16090'); $rss = simplexml_load_string($feed); $doc = new domdocument(); @$doc->loadhtml($feed); $tags = $doc->getelementsbytagname('link'); foreach ($tags $tag) { foreach($rss $r){ $title = $r->title; $content = $r->content; $link = $tag->getattribute('href'); echo "<a href='$link'>$title</a> <br> $content"; } } ?> where mistake? why it's not working , how make work properly? in advance! both loops going through different resources cross joining records in them. this should work data need: <?php $feed = file_get_contents('http://grabo.bg/rss/?city=&affid=16090'); $rss = simplexml_load_string($feed); forea...

c# 4.0 - how to add object to a list in a view? -

Image
i have typed view have form. display values of contact (object) in textboxes. contact has list of functions. have list of functions exist in database. in view i'm listing functions displaying checkboxes (value : id of function, display : name of function). before that, compare list of contact's functions functions , checked of contact. : @foreach (extranetclient.models.classes.fonctioncontact fonction in viewbag.fonctions) { string coche = ""; if ((@model.listefonctions).where(c => c.idfonction == fonction.idfonction).count() > 0) { coche = "checked"; } <input type="checkbox" @coche id="@fonction.idfonction" />@fonction.libellefonction <br /> } it looks that: but now, if user checks checkbox add function contact, need save in contact's list. cannot find how that. has ide...

jquery - Horizontal Javascript menu error -

i have small problem javascript menu. when choose item shows me last sub menu. this simple people professionals in javascript :p here sample: css ul#midnav { border-width: 1px 0; list-style: none; margin-bottom: 5px; text-align: center; border-bottom: solid thin #c8c8c8; padding: 0px 0px 13px 0px; } ul#midnav li { display: inline; padding: 0px 0px; } ul#midnav li { text-transform:uppercase; font-size:11px; padding: 5px 13px 0px 5px; background: url('../image/arrow-topdown-gray.png') 100% 9px no-repeat; } ul#midnav li ul { line-height: 28px; padding: 0; position: absolute; top: -30px; background: none; display: none; /* --hide default--*/ width: 960px; height:28px; background: #fff; border-top: solid thin #eeeeed; } ul#midnav li ul { background: url('../image/arrow-left-gray.png') 100% 9px no-repeat; } html <div id="navigation"> <div id...

regex - .htaccess dash separator 2 params or more -

i'm working .htaccess , , want make friendly urls. my current url: www.url.com/index.php?v=[something]&i=[idiom] but can be: www.url.com/index.php?v=[something] what want: www.url.com/[something]-[idiom] or in second case: www.url.com/[something] .htaccess config made: rewriterule ^([^/]+)-([^/]+)?$ index.php?v=$1&i=$2 writing www.url.com/[something]-[idiom] goes okay, webpage running properly. in second case have write www.url.com/[something]**-** . if write www.url.com/[something] page breaks. so, want make second param optional, , separated dash if it's possible. can 1 me please? it won't match www.url.com/[something] because expects - @ end. include - inside second capturing group, so: ^([^/]+?)(-[^/]+)?$ also changed first greedy quantifier lazy 1 avoid matching much.

c# - Displaying 2 columns in one combobox -

i have employee table. want combobox present employee number , city. sqlcommand cmd = new sqlcommand(); connection c = new connection(); cmd.commandtext = "select employeenumber, city tblemployee"; sqldataadapter adp = new sqldataadapter(cmd); dataset ds = new dataset(); adp.fill(ds, "employee"); combobox1.datasource = ds; that's got far, can me that? you can add format event combobox, , in compose whatever want show: private void _combobox1_format(object sender, listcontrolconverteventargs e) { var x = (datefiltertype)e.listitem; e.value = /* insert string concatenation stuff here... */; }

c# - Hourly collection of files across network -

i'm working on application in c# allow user select 1 or more networked drives or computers , collect data logs folder (folder location same on drive/pc) files must collected hourly, @ 10am application collect data logs of 9am each designated folder.. i'd occur in separate thread automatically on hour, every hour long application running in background. issue have not familiar how set timer/hourly system thread can made , run hourly. if has advise or ways perform please let me know. *i'm looking options coded this, distributed 40 or 50 different pcs use windows task scheduler invoke program. make sure don't miss invocations, code invoked @ right time , can deploy next version of tool using xcopy. i think can retry failed jobs, send error reports , such. you can script task using .bat-file or create using c#. mass-deployable.

ember.js - How to update record in local storage using ember data and localstorage adapter? -

i new emberjs , making 1 simple crud application. using ember data , localstorage-adapter save record in local storage of browser. i trying update record using localstorage-adapter throwing error. i have listed code here : updatecontact: function(){//save data in local storage var fname = this.obj_form_edit_data.get('cont_data.fname'); var lname = this.get('cont_data.lname'); var email = this.get('cont_data.email'); var contactno = this.get('cont_data.contactno'); var gendertype = ((this.get('ismale') == true) ? true : false); var contactype = $(".selectpicker").val(); grid.modalmodel.updaterecords({ fname: fname, lname: lname, email: email, contactno: contactno, gendertype: gendertype, contactype: contactype }); this.get('store').commit(); } i getting following error ...

javascript - How do I make a ajax-loaded UL sortable in a JQuery UI dialog? -

i need load ul in background , present in dialog sorting, i'm new jquery/jquery ui , having trouble google. far i've got: $(document).on('click','a.priority', function(){ // url of link var href = $(this).attr('href'); // tell page expect js instead href = href + "/ajax"; // page content $.get(href, function(data){ // initialise dialog content var my_dialog = $('<div></div>') .dialog({ autoopen: false ,open: function (event, ui) { // add result of (a ul) dialog's content my_dialog.html(data); // make sortable, how? my_dialog.sortable().disableselection(); // set dialog title (this dynamic later, , might need call single dialog gets remangled rather creating 1 every time) my_dialog.dialog("option","t...

Can I remove Java 6 and Android still working? -

Image
i have java 6, , working on eclipse android programming. installed java 7 , of sudden, java website told me have versions can remove. photo: if removed these versions, can eclipse , android programs keep working? eclipse , android work java 6 or 7. need 1 of 2 running (if don't have java @ won't work). building android platform issue entirely... keep in mind android runs java 6 won't able use java 7 runtime features not backwards compatible. see here eclipse compatibility see this answer android compatibility.

Is it the C# compiler or the CLR that prohibits multiple inheritance -

exactly title says. is restriction placed c# compiler or clr fundamentally prohibit it? both. the c# language, not directly tied clr (i.e. mono aot) not allow multiple inheritance. the clr type system, supports languages other c#, not support multiple inheritance.

image - Online tool to decode base64 string to png -

does know if there online tool decode base64 encoded strings png files. my base64 string follows http://pastebin.com/bfc1e1nv yes, such tool exists, example, this: http://www.motobit.com/util/base64-decoder-encoder.asp

Google's SNAPPY algorithm implementation in javascript (client side) -

i need use snappy compress data client side (javascript code), send server side, receive data server side , decompress @ client side (javascript code). concern 1 : this answer not appreciate native javascript implementation. do? concern 2 : appreciate if may provide pointer on how go or reference regarding same. what shall implication, in case snappy algorithm gets new release or bug fix - have to maintain overhead of updating client side implementation? suggestions... ? you might use emscripten, c/c++ js compiler on https://github.com/andikleen/snappy-c or http://code.google.com/p/snappy/ itself

php - why is echo changing font size on the rest of my page? -

Image
i'm getting angry @ this, i'm setting jquery dialog box, heres code i'm using echo it: echo " <div class='dialog' title='edit record'> <form method='post'> <table> <tr> <td>name</td> <td><input type='text' value='$row[name]' name='name'></td> </tr> <tr> <td>cash down</td> <td><input type='text' value='$row[cash]' name='cash'></td> </tr> <tr> <td>amount</td> <td><input type='text' value='$row[amount]' name='amount'></td> </tr> <tr> <td>mem type</td> <td><input type='text...

is_null behaviour php laravel 4 -

i in process of building small api system using laravel. small piece of code searches user, , if exists, sends json response back. when ran code such should return no user(usercontent {}), is_null still returns false. thought should return true in case. had planned use in code check if users exist, seems failing everytime. have misunderstood something? can explain missed? thanks. response code: if($user) { return response::json(array( 'error' => 'true', 'message' => 'user exists.', 'user' => is_null($user), 'usertype' => gettype($user), 'usercontent' => $user ), 400); } response json: { "error":"true", "message":"user exists.", "user":false, "usertype":"object", "usercontent":{} } edit: i did var_dump($user); var_dump(empty($user)); which seem retu...

Play sound file one after another in android -

i trying play sound in android 1 after "res/raw" folder. playing first sound sounds array. there other way it? there 3 sound file in raw folder 1.aa.ogg 2.ma.ogg 3.ar.ogg package com.protonray.calculatorplus; import java.util.list; import android.media.mediaplayer; import android.media.mediaplayer.oncompletionlistener; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.app.activity; public class layoutnew extends activity{ int count=0; int[] sounds={r.raw.aa,r.raw.ma,r.raw.ar }; mediaplayer mp=new mediaplayer(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.layout_new); button play=(button) findviewbyid(r.id.play); play.setonclicklistener(new view.onclicklistener() { @override ...

osx - Excel for Mac - Cells containing user-defined functions won't update -

i'm working on vba code writes formulas containing user-defined functions (udfs) cells of workbook, e.g.: h1004 = maxdd(h1:h1001) . when run code in excel 2010 (for windows) works expected: 1) formulas written cells 2) each cell returns correct result. when run same code in excel 2011 mac formulas written cells. however, cells won't return valid results - instead display #value errors. note: can't troubleshoot issue because when select 1 of these cells, put cursor in formula field, , press return (presumably forcing cell evaluate), correct answer appears. my question: what needs done keep excel mac returning #value errors instead of plain results? i figured out what caused problem, although have no idea why caused problem: in order make vba code run faster, had turned off automatic calculation @ beginning of code , turned on @ end of code, --> application.calculation = xlcalculationmanual 'main part of vba code ...

Problems with Android and Eclipse Functionality -

Image
i coming xcode , ios development android. downloaded sdk right here http://developer.android.com/sdk/index.html . seems unstable , things don't work, ie dragging textclock activity, need, throws null reference exception no guidance on wrong , layouts not staying lined when move or make seemingly trivial change. mind numbing , frustrating @ point, point feel set wrong or there issue it. know if might case or if there link describes gotchas eclipse , android , how through them without smashing mouse , keyboard first? below screen of happens after dragging in textclock. opened details window. this bad question , voted close it. however, it's (if obvious) observation. yes, tooling sucks. main problem - each upgrade of each element (eclipse, adt, sdk) brings new problems , gotchas, cannot find out workarounds , on work. have learn live occasional surprises , constant feeling of bewilderment , instability. the relatively news after couple of months develop (...

Design for max hash size given N-digit numerical input and collision related target -

assume hacker obtains data set of stored hashes, salts, pepper, , algorithm , has access unlimited computing resources. wish determine max hash size certainty of determining original input string nominally equal target certainty percentage. constraints: the input string limited 8 numeric characters uniformly distributed. there no inter-digit relation such checksum digit. the target nominal certainty percentage 1%. assume hashing function uniform. what maximum hash size in bytes there nominally 100 (i.e. 1% certainty) 8-digit values compute same hash? should possible generalize n numerical digits , x% accepted answer. please include whether there issues using first n bytes of standard 20 byte sha1 acceptable implementation. it recognized this approach increase susceptibility brute force attack increasing possible "correct" answers there design trade off , additional measures may required (time delays, multiple validation stages, etc). ...

Rails 4 Heroku Mysql to Postgres Dump Pending Migrations -

i've converted mysql db postgres . i'm used following import db: heroku pgbackups:restore database 'http://app.com' --app this creates tables , imports data. the problem have following: heroku run rake db:seed --app then list of pending migrations. is there way ignore these, reset it, or doing wrong? thank you

How to loop through & display Javascript Multidimensional Array -

i have testing search software , stores data in multidimensional array. can return whole database cannot return 1 value. i'm trying figure out how return 1 section multidimensional array. otherwise repeats passed value across display. while de-bugging can see complete array stored argument having trouble figuring out how loop through array display correctly. may need view source understand better. if enter lets 439023483 , click search isbn button, see issue. show button works fine. pointing me in right direction appreciated , thank in advance. here link testing source: http://mdhmotors.com/jstesting/test.html here part of code i'm stuck on: function searchbyisbn(isbn) { var isbn = document.getelementbyid('isbn').value; showbooks(getbookbyisbn(isbn)); } function getbookbyisbn(isbn) { var foundbook = null; (b in bookstore) { var book = bookstore[b]; if (book[isbn] == isbn) { foundbook = new array(book[isbn], book[title...

ruby - Iterate over loop accessing two elements if they exist -

well, haven't found clean solution write code in ruby: # java style version: array.each |i, el| if < array.length - 1 process(array[i], array[i+1]) end end # nice if this: array.each |i, el, next| process(el, next) end you can use each_cons : array.each_cons(2) |a, b| process(a, b) end

how to override error method in c# log4net -

i ask if possible override log methods or create new 1 properties in method. at moment can use it: globalcontext.properites["details"] = "some info"; log.error("some info",exception); i use it: log.myspecialerror(details, message, exception); any advice appreciated ori create own extension method. it must defined in static class, , static method. e.g. definitions: public static class log4netextensions { public static void myspecialerror(this log log, string details, string message, exception exception) { //do parameters } } use: log.myspecialerror(details, message, ex);

MySQL stored procedure OUT param returned as null (NO LOCAL VARIABLE DECLARED) -

i trying debug problem. i've gone great extremes , trying figure out why mysql return null when return var explicitly set value. delimiter $$ create definer=`root`@`localhost` procedure `foo`( out numberexpectedtofill int(11)) deterministic begin set numberexpectedtofill := 23; commit; end so, scripted little script call it, , return value null. why? prepare s 'call `test_schema`.`foo`(@output)'; execute s; select @output this unexpected ... works in sqlfiddle both , without using prepared statement: http://sqlfiddle.com/#!2/d4ddf/1 , http://sqlfiddle.com/#!2/d4ddf/2 maybe there problem permissions (would signal error, thought) ?!? edit: still guessing -- sure call foo right schema? o_o

c# - does not contain a constructor that takes '1' arguments -

i've searched few topics i'm still stuck, i'm new c# , error starting give me headache. i'm trying initilise list keep getting error message. welcome. public static list<bookoperator> createbookoperators() { list<bookoperator> ops = new list<bookoperator>(); bookoperator op = new bookoperator(ops); ops.add(op); return ops; } it looks me there no reason try , pass list book-operator. money says: public static list<bookoperator> createbookoperators() { list<bookoperator> ops = new list<bookoperator>(); bookoperator op = new bookoperator(); ops.add(op); return ops; } or more tersely: public static list<bookoperator> createbookoperators() { return new list<bookoperator> { new bookoperator() }; }

ruby on rails - activemodel - updating children of object when saving parent -

this followup question here: updating child association in activemodel i'm looking standard/correct way update number of children records associated parent. lets have parent (connected child table has_many, , :autosave=>true). obj = parent.first now iterate on children, , update them. obj.each.do |child| child.remark = "something" end i children saved parent, when calling obj.save, explained me in previous question, way update directly, this: obj.children.first.remark = "something" (or save each child, require explicit transaction believe shouldn't used here). what correct way implement this? thanks! *edit : following advice given here, i've added model: class parent < activerecord::base has_many :children, :inverse_of => :parent,:autosave=>true accepts_nested_attributes_for :children but still, x = parent.first c = x.children.first c.remark = "something" x.save # => doesn't...

concatenation - sql - concatenating case statements -

i want similar to: select ('['+twt.dept+']' + case when twt.typ <> 'empty' , twt.typ > '' '-['+twt.typ+']' end + case when twt.subtyp_1 <> 'empty' , twt.subtyp_1 > '' '-['+twt.subtyp_1+']' end + case when twt.subtyp_2 <> 'empty' , twt.subtyp_2 > '' '-['+twt.subtyp_2+']' end + case when twt.subtyp_3 <> 'empty' , twt.subtyp_3 > '' '-['+twt.subtyp_3+']' end) category table1 tb1 join table2 twt on (tb1.id = twt.id) i know can use coalesce or using stacking cases, anyways use simpler looking syntax have here achieve (especially without having monster case statement 5th case)? ps category coming empty, while have verified atleast 2 of field above contain values. i hoping [shoes]-[sandals]-[pancakes]-[cinnamon bun] i don't think can make query shorter. use separate ...

android - WebView must be loaded twice to load correctly -

when page webview first loads, images missing or displayed incorrectly. if reload page webview displays perfectly. know first think set javascript after loadurl, isn't true. in oncreate have: learnwebview = (webview)findviewbyid(r.id.learnwebview); learnwebview.setwebviewclient(new webviewclient()); learnwebview.getsettings().setjavascriptenabled(true); then later in function called after oncreate have: learnwebview.loadurl("myurl"); and yes, know function loadurl called after oncreate every time. please try instead of way, bad practice: learnwebview.post(new runnable() { @override public void run() { learnwebview.loadurl("myurl"); } }); or this, in case first 1 wont work: learnwebview.postdelayed(new runnable() { @override public void run() { learnwebview.loadurl("myurl"); } }, 500); h...

How do I synchronize the color and depth sensors for Kinect for Windows using MATLAB? -

i capturing color , depth images kinect windows using matlab , official kinect sdk. both sensors synchronized such image each sensor of same moment. unfortunately, current implementation has lag between 2 sensors (of 1 second!). please me find way synchronize sensors. here current code: colorvid = videoinput('kinect',1,'rgb_640x480'); depthvid = videoinput('kinect',2,'depth_640x480'); triggerconfig([colorvid depthvid],'manual'); set([colorvid depthvid], 'framespertrigger', 300); start([colorvid depthvid]); trigger([colorvid depthvid]); pause(10); [imgcolor, ts_color, metadata_color] = getdata(colorvid); [imgdepth, ts_depth, metadata_depth] = getdata(depthvid); stop([colorvid depthvid]); delete([colorvid depthvid]); clear colorvid depthvid; i've played while , seems adding pause between start() , trigger() functions solves problem! start([colorvid depthvid],'framespertrigger',300); pause(1); trigger([colorvid d...

networking - Adding a network printer via link -

i trying install printer giving users link. i need make website users able click on hyperlink install network printer them. the solution have runs vb script , requires activex makes confuses users. the solution example... <!doctype html> <html> <script type="text/vbscript"> function addp(pname) msgbox "adding..." set wshnetwork = createobject("wscript.network") wshnetwork.addwindowsprinterconnection pname msgbox "the printer added!" end function </script> </head> <body> <div class="gridcontainer clearfix"> <div> <a href='#' language="vbscript" onclick="addp('printer location')">add printer</a> </div> </div> </body> </html> the solution works on win 7 32 bit ie8. is there other solution available this, can use html , javascript solve this.

nlog - Write access to the local file system inside a Visual Studio Add-In -

i developing add-in (in c#) visual studio 2012 , trying use nlog log information add-in code local log file (e.g. in same local directory add-in being loaded from). nothing being logged , when debugged things more seems not have write access local file system inside add-in code. trying open local file , write line throws system.unauthorizedaccessexception: [system.unauthorizedaccessexception] = {"access path 'c:\\program files (x86)\\microsoft visual studio 11.0\\common7\\ide\\test.txt' denied."} is basic limitation add-ins? vs not allow write access local file system? thanks insight can offer alan after digging around in nlog source code figured out going on here. the real problem was putting nlog.config file in wrong place , nlog not finding it. putting in add-in directory .addin file , binaries. rather throwing kind of exception nlog silently disabling logging. reasonable behavior in hindsight since it's legitimate logging disabled ...

Matlab segmentation of CT scan -

i have image similar this: this http://bjr.birjournals.org/content/84/special_issue_3/s338/f9.large.jpg i want segment aorta(where arrow pointing) , rid of rest of anatomy. i'm new matlab , not sure how start. so far have this: clear all; img = imread('~/desktop/aorta.jpg'); img1 = rgb2gray(img); imgh = histeq(img1); bw = im2bw(imgh,.9); remove = bwareaopen(bw,5000); l = bwlabel(remove); s = regionprops(l, 'perimeter'); my thought use perimeter value compare roundness , use ismember exclude rest, i'm not sure how implement , couldn't find examples explaining how to. can explain how that? also, strategy best way this? thanks! in medical imaging applications accurate segmentation needed, run time less important. if case, suggest using active contours called "snakes". the idea behind segmentation technique find optimal segmentation satisfies strong edge (high gradient) , short (or smooth) curve. in context of snakes these ...

Copying localhost MongoDB data to meteor servers -

so have been playing around meteor , mongodb , have working version set on localhost. unfortunately, when meteor deploy xxx.meteor.com doesn't deploy database well. how do this? meter deploy deploys fresh database. copy on data have use mongorestore local mongodb dump, can make mongodump ( docs ) so first dump database somewhere mongodump --host localhost:3002 get mongodb`s credentials running (in project dir): meteor mongo myapp.meteor.com --url this give database details in form: mongodb:// username : password @ host : port / databasename then can plug these mongorestore ( docs ) , restore local database over mongorestore -u username -p password -h host:port -d databasename ~/desktop/location_of_your_mongodb_dump

javascript - Google Closure Compiler Includes -

i've been using google closure compiler little bit projects, it's awesome! i've been trying find out whether or not can "includes" in javascript file includes other javascript files. i'm trying have 1 javascript file "includes" files need compiles, can less import statement, ("@import "../less/bootstrap") example. is possible? - or have provide list of source files @ time of compilation in command line? many thanks! when using closure-library "includes" handled via goog.require calls. see https://developers.google.com/closure/library/docs/tutorial#zippy in un-compiled code, included scripts dynamically inserted. during compilation, compiler include necessary scripts , dead-code elimination remove unused methods , symbols. other options the popular option handling javascript includes/dependencies requirejs . requirejs dynamic script insertion. closure-compiler has common js pass translates requirejs ...

Minecraft bukkit scheduler and procedural instance naming -

this question pretty obvious person knows how use bukkit properly, , i'm sorry if missed solution in others, kicking ass , don't know else do, tutorials have been utterly useless. there 2 things need doing: i need learn how create indefinite number of instances of object. figure it'd this: int num = 0; public void create(){ string name = chocolate + num; thingy name = new thingy(); } so see i'm saying? need change name given each new instance doesn't overwrite last 1 when created. swear i've looked everywhere, i've asked java professor , can't answers. 2: need learn how use stupid scheduler, , can't understand far. basically, when event detected, 2 things called: 1 method activates instantly, , 1 needs given 5 second delay, called. code this: public onevent(event e){ thingy thing = new thingy(); thing.method1(); thing.doondelay(method2(), 100 ticks); } once again, apologize if not giving many specifics, can...

php - Joomla 3 custom Template -

Image
i'd achieve following content structure no template know fits it. can advice me template start modifying? thought of "category blog". i'm planning integrate years adding categories contain categories caption/description containig articles want shown in view. in addition i'd feel grateful providing me sources learn more how data need (categories description, articles headline , content). i until did css adjustments joomla based websites , therefore don't know how reviece data db. php , mysql aren't problem though. a bit fuzzy maybe because don't know start i'm hoping best. thanks lot :)

javascript - PHP : multiple inputs into other multiple inputs -

i using jquery add / remove inputs i use append add multiple tr date / revenue also use append add multiple td revenue in same tr of date i add multiple date inputs , table add multiple revenue inputs i have use name="date[]" can use loop , insert each 1 in mysql table but in sametime there multiple name="revenue[]" here example <form method="post" action =""> <table> <tr> <td>date : <input type="text" name="date[]" value="25/07/2013"></td> <td>revenue : <input type="text" name="revenue[]" value="1"><br> revenue : <input type="text" name="revenue[]" value="2" ><br> </td> </tr> <tr> <td>date : <input type="text" name="date[]" value="26/07/2013"> </td> <td> revenue : <input typ...

d3.js - How do you get selected datums in brush "brush" event handler? -

i attempting create vertical timeline using d3.js linked map item(s) contained in brush displayed in map. kind of http://code.google.com/p/timemap/ d3 instead of simile , vertical timeline rather horizontal. i can create svg vertical bars representing time ranges, legend, ticks, , brush. function handling brush events getting called , can obtain extent contains y-axis start , stop of brush. far good... how 1 obtain datums covered brush? iterate on initial data set looking items within extent range feels hacky. there d3 specific way of getting datums highlighted brush? var data = [ { start: 1375840800, stop: 1375844400, lat: 0.0, lon: 0.0 } ]; var min = 1375833600; //aug 7th 00:00:00 var max = 1375919999; //aug 7th 23:59:59 var yscale = d3.time.scale.utc().domain([min, max]).range([0, height]) var brush = d3.svg.brush().y(yscale).on("brush", brushmove); var timeline = d3.select("#mydivid").append("svg").attr("width...

reading $, . and number in python regex -

i want able read price in given line, example: $.0001 ... i'm trying read $.0001 part following regex: new_string = re.search(r'\$([.]\d+)', description) what different approaches same problem? for single data point you've suggested, current pattern work fine. however, if may need match against more diverse range of values, might need more flexible pattern. for instance, if it's possible values of $1 or more appear in input, you'll need able match digits before decimal point: new_string = re.search(r'\$(\d*[.]\d+)', description) # can match "$1.001" further, if might whole number values without decimals, might need make decimal point , following digits optional: new_string = re.search(r'\$(\d*(?:[.]\d+)?)', description) # can match "$2" finally, note on style. i'm not sure if there regex style guides out there, personal taste use escape sequence decimal point, rather one-character character ...

c# - How would I add a parameter to entity framework raw sql command -

how add parameter following entity framework raw sql command? example, if wanted make id parameter? using (var context = new northwinddbentities()) { context.database.executesqlcommand(@" update dbo.customers set name = 'test' id = 1 "); } context.database.executesqlcommand(@"update dbo.customers set name = 'test' id = @id", new sqlparameter("id", 1)); in case of multiple parameters context.database.executesqlcommand(@"update dbo.customers set name = 'test' id = @id , name =@name", new sqlparameter("id", id), new sqlparameter("name", fname));

multithreading - How can a background thread modify the UI in between Activity loads in Android? -

i have download process runs in background, , updates ui progress (a listview adapter). works fine until leave activity , come back. after loading activity again there "new" listview object not same 1 bound bg download process. how can structure code background process can talk listview in activity? the specific line is: adapter.notifydatasetchanged(); here shell of download class: public class download { } protected void start() { transfermanager tx = new transfermanager(credentials); this.download = tx.download(s3_bucket, s3_dir + arr_videos.get(position), new_video_file); download.addprogresslistener(new progresslistener() { public void progresschanged(final progressevent pe) { handler.post( new runnable() { @override public void run() { if ( pe.geteventcode() == progressevent.completed_event_code ) ...

javascript - Backbone not making a put request with save() after save -

i experiencing interesting problem backbone, have function in 1 of views: addpeople :function(){ var autharray = _.clone(this.model.get("authorizedusers")); var values = $(".add-input").val().split(","); values.foreach(function(value) { autharray.push(value); }); this.model.set("authorizedusers" , autharray); this.model.save(); }, this function gets called when button clicked. version of function triggers change event because cloning array, reason this.model.save() never gets called, aka server never receives put request. when refresh page go old state of model.. however if dont clone array , change function to, this: addpeople :function(){ var autharray = this.model.get("authorizedusers"); var values = $(".add-input").val().split(","); values.foreach(function(value) { autharray.push(value); }); ...

large data - Exception of type 'System.OutOfMemoryException' was thrown. C# when using Memory stream -

i working wpf application , memory stream write method used in write dicom data bytes.it shows exception of type system.outofmemoryexception when try write big dicom data having size more 70 mb. can please suggest solution resolve this. the piece of code try { using ( memorystream imagememorystream = new memorystream()) { while (true) { // retrieve dicomdata. // data comes chunks; if file size larger, multiple retrievedicomdata() calls // has raised. return value specifies whether chunk last 1 or not. dicomdata = dicomservice.retrievedicomdata( hierarchyinfo ); imagememorystream.write( dicomdata.databytes, 0, dicomdata.databytes.length ); if (dicomdata.islastchunk) { // data smaller; ...

php - How to forward the post file to an other server to the same script -

i have following script <?php $target_path = $_server[document_root]."/files/cache/"; $target_path = $target_path . basename( $_files['uploadedfile']['name']); if(move_uploaded_file($_files['uploadedfile']['tmp_name'], $target_path)) { echo "the file ". basename( $_files['uploadedfile']['name'])." has been uploaded"; } else{ echo "there error uploading file, please try again!"; } ?> i modify so, file uploaded on server , script on server calls script, can see here, on server b, because can't call script directly. how can like? on server b, it's clear, use top script. have think script on server a. i think have call script on server b server function file_get_contents(...) <?php $target_path = $_server[document_root]."/files/cache/"; $target_path = $target_path . basename( $_files['uploadedfile']['name']); if(...

jQuery Isotype items overlapping onLoad in IE8 - defined width list items, not images -

Image
the issue isotope's overlapping items documented, seems else using images , problem solved using $(window).load(function(){ ..... }); or 'imagesloaded' plugin. i finding browsers work fine except ie8 experience overlapping. problem onload; if click of filters style correct. i've tried wrapping script in $(window).load(function(){ ..... }); , doesn't work! when use ie inspector, appears though width isotope calculating 80px off in ie8. these in <ul> , <li> 's have defined of 349px. in chrome, when use inspector can see adds correct width of 379px (this 349px width + 30px left margin) in inline stlyes on <li> element: position: absolute; left: 0px; top: 0px; -webkit-transform: translate3d(379px, 0px, 0px); in ie8, however, adds following inline style: left: 299px; top: 0px; position: absolute; other css details: the margin left of each item 30px the container <ul> has negative margin of -30px level grid the ...

Removing a character from a string in Python using strip() -

i have 2 strings. dat: "13/08/08 tim: 12:05:51+22" i want " character stripped both strings. here code using: dat=dat.strip('"') tim=tim.strip('"') the resulting strings are: dat: 13/08/08 tim: 12:05:51+22" why " character not removed tim? according documentation here ( http://www.tutorialspoint.com/python/string_strip.htm ) should work. according docs , strip([chars]) : return copy of string leading , trailing characters removed. chars argument string specifying set of characters removed. so, " won't replaced dat: "13/08/08 , replaced tim: 12:05:51+22" because here " @ end: >>> dat = 'dat: "13/08/08' >>> tim = 'tim: 12:05:51+22"' >>> dat.strip('"') 'dat: "13/08/08' >>> tim.strip('"') 'tim: 12:05:51+22' use replace() instead: >>> dat.replace('...

javascript - js mobile printing by APD -

im use zebra imz320 mobile printer , mc3110 (wm). use bluetooth connection. js code is: function print(str) { var printerid = 'bz:1|0022583cbd61'; apd.psexternal(261, printerid); apd.psexternal(270, ""); str = '^xa^mmt^pw559^ll050^ls0^ft27,40^a@n,15,15,tt0003m_^fh^ci28^fh^fdАБВГДЕЁЖЗИКЛМНОПРСТУФХТЦЧШЩЬЪЭЮЯабвгдеёжзиклмнопрстуфхтцчшщьъэюя^fs^ci0^pq1,0,1,y^xz' apd.psexternalex(266, str); apd.psexternal(271, ""); } right printing part of string - 'РСТУФХТЦЧШЩЬЪЭЮЯабвгдеёжзиклмноп' . parts 'АБВГДЕЁЖЗИКЛМНОП' , 'рстуфхтцчшщьъэюя' not printing or printing ubnormaly. zebra setup utility zpl command printing right. printing right using rhomobile bluetooth device capability technology > (send_string('^xa^mmt^pw559^ll050^ls0^ft27,40^a@n,15,15,tt0003m_^fh^ci28^fh^fdАБВГДЕЁЖЗИКЛМНОПРСТУФХТЦЧШЩЬЪЭЮЯабвгдеёжзиклмнопрстуфхтцчшщьъэюя^fs^ci0^pq1,0,1,y^xz')) . im try print russian symbols use...

visual studio 2010 - How to automate the uni test code generation in MStest -

i using mstest unit test code. if want automate unit test code public api, how do it. i using vs 2010 . new mstest . can guide me on how acheive this? take @ pex, research project microsoft. pex automatically generates test suites high code coverage. right visual studio code editor, pex finds interesting input-output values of methods, can save small test suite high code coverage. microsoft pex visual studio add-in testing .net framework applications. http://research.microsoft.com/en-us/projects/pex/

Maven build modules out of order -

i trying build maven project has several modules. expect them built in order given in pom.xml ,but can seen order of modules in build not same order mentioned in pom.xml file. can reason ? my maven version : apache maven 3.0.4 maven decides order based on dependencies. if have 3 submodules: a, b c, need go each submodule , make dependency explicit. example, if go pom.xml of b , declare depends on , c, maven build , c in random order, , build b @ end.

Tomcat 6 MySQL -> strange connection error -

i have ubuntu server apache -> mod_jk -> tomcat 6 -> mysql. everytime tomcat loads new *.war or restarted, gives me error: com.mysql.jdbc.exceptions.jdbc4.communicationsexception: communications link failure last packet sent server 0 milliseconds ago. driver has not received packets server. @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:532) and strange thing: after time (sometimes minutes or hours) , doing nothing, applications works charm - without other errors. the connection set tomcat (with context-container) , goes 127.0.0.1 there no problem phpmyadmin. remy, issue unfortunately not have "simple" answer, varies on many things. error receiving gen...