Posts

Showing posts from September, 2012

command line - Ruby commandline program exit then message appears -

command line - Ruby commandline program exit then message appears - trying write ruby command line interface. when programme exits, message appear. here program: require 'open-uri' url = argv[0] if url.nil? abort "no url provided" end begin puts open(url) rescue => e abort e.message end i following > ruby -ilib bin/command http://iservice.ltn.com.tw/2014/specials/nonukes/news.php?rno=1&type=l&no=998123 [1] 8642 [2] 8643 [2]+ done type=l > #<stringio:0x007fdf96ac82f8> [1]+ done ruby -ilib bin/command http://iservice.ltn.com.tw/2014/specials/nonukes/news.php?rno=1&type=l&no=998123 > as can see, unusual lines appears first such [1] 8642 , programme exits. , after sec shell prints out #<stringio:0x007fdf96ac82f8> , , hangs there. have press come in in order exit program. update seems happens url such the 1 listed in example. why programme exits print resu...

Highcharts: collecting all charts on a page second time produces error -

Highcharts: collecting all charts on a page second time produces error - i have puzzling situation. i have page few column charts. on page, there link, clicking on builds form , sends info server, sends pdf document: $('#my-link").click(function(ev) { var svgarray=[]; $(highcharts.charts).each(function(i, chart){ svgarray.push(chart.getsvg()); <!--show error "typeerror: chart undefined" in firefox when clicking on sec time without refreshing page --> }); var svgjson = json.stringify(svgarray); var form = $('#my-form'); var ele = $('<input name="chartsvgarray" style="display: none" value="' + $.base64('encode', svgjson) + '">'); form.append(ele); form.submit(); ev.preventdefault(); }); the browser able pdf document (with charts in it) server , prompts me opening or saving it. in abo...

php - Can't access laravel page in vhost setup -

php - Can't access laravel page in vhost setup - i have problem set of laravel using vhost. have different projects using vhost , has no problem when seek set laravel can't access in web browser. redirect google page , searching vhost url. so far here's did. i included vhost entry in httpd-vhosts.conf file <virtualhost *:80> servername dev.laravel_validation.local serveralias dev.laravel_validation.local documentroot "c:/users/web4/desktop/laravel/laravel_validation/public" <directory "c:/users/web4/desktop/laravel/laravel_validation/public"> options indexes followsymlinks multiviews allowoverride order allow,deny allow </directory> </virtualhost> i include name in windows hosts file 127.0.0.1 dev.laravel_validation.local then restart wampserver. , access url dev.laravel_validation.local browser doesn't display laravel's welcome page. i ...

.net - How to save graphic create by Graphics.DrawLine on PictureBox -

.net - How to save graphic create by Graphics.DrawLine on PictureBox - its possibility save graphic create graphics.drawline on picturebox image picturebox? its seen this: http://pl.tinypic.com/r/140k6xf/8 my drawing function: public sub picturebox2_mouseclick(byval sender object, byval e system.windows.forms.mouseeventargs) handles me.mousedown if picturebox1.image nil msgbox("upload image first", msgboxstyle.critical) else dim g graphics = graphics.fromimage(picturebox1.image) dim blackpen new drawing.pen(colordialog1.color, 0.5) dim currpoint point dim drawfont new font("arial", 8) dim drawbrush new solidbrush(colordialog1.color) dim drawformat new stringformat drawformat.alignment = stringalignment.center g = picturebox1.creategraphics() if previouspoint.isempty = true previouspoint = new point(e.x - 231, e.y - 52) mpx1 = e.x ...

c++ - Linux fork() + pipe() confusion -

c++ - Linux fork() + pipe() confusion - i'm having little bit of problem writing lastly bit of recommended exercise (personal shell), mainly, forking final execvp in chained command composition via pipe ( | ). while actual piping works 1 execvp another, final execvp within of execute() function not forked , hence kill master programme when executed. however, when effort fork it, funny behavior on terminal. namely, duplicate entries on stdout. ultimately, main question have this: how can fork final execvp in execute() without messing out input , output pipes? could please point me in right direction how fork process 1 final time in order safely execute execvp without messing out final pipes , disrupting parent shell? the logic works so: take in string of input --> convert vector of strings-- > pass vector execute(), fires off execprocess() if sees more 1 command because requires piping. the final execvp in execute() meant run lone command of simple input ...

CRUD implementation using Laravel 4 (code review) -

CRUD implementation using Laravel 4 (code review) - i not sure if allowed here inquire code review, i'll give seek code improvements. ok started using laravel 4, read tutorials on how implement crud in laravel. , able develop portion of it. going show more on controller , eloquent orm. i have here 2 models "group" can have 1 "country", "country" can assigned different "group" ("one many") group model class grouping extends eloquent { protected $table = 'group'; protected $guarded = array('group_id'); protected $primarykey = 'group_id'; public function country() { homecoming $this->belongsto('country', 'country_id'); } } country model class country extends eloquent { protected $table = 'country'; protected $primarykey = 'country_id'; public function group() { homecoming $this->hasmany('grou...

xcode - How to access image files in a today notification widget -

xcode - How to access image files in a today notification widget - is there kind of restriction when accessing image through widgets extension? have image within widget extension supporting files grouping called pocket.png i want utilize image through widget custom view controller , usual wrote code var pocketimage:uiimage = uiimage(named: "pocket") to surprise code returns blank. tried pocket.png same problem. now tried image path , below code returns nil let pathx = nsbundle.mainbundle().pathforresource("pocket", oftype: "png") so how access local available image? note: same code works fine when utilize in main application local image. there issue xcode didn't re-create images properly. had delete , re-create them 1 time again prepare issue. xcode swift widget ios8-today-widget

c# - Retrieve process information and files from a remoted machine -

c# - Retrieve process information and files from a remoted machine - i’m trying retrieve specific process using next code: process[] process = process.getprocessesbyname(_processname, _ip); when _ip “127.0.0.1”, process retrieved successfully. when _ip represents remote machine, next exception occurs: system.invalidoperationexception occurred hresult=-2146233079 message=couldn't connect remote machine. source=system stacktrace: @ system.diagnostics.ntprocessmanager.getprocessinfos(string machinename, boolean isremotemachine) @ system.diagnostics.processmanager.getprocessinfos(string machinename) @ system.diagnostics.process.getprocesses(string machinename) @ system.diagnostics.process.getprocessesbyname(string processname, string machinename) @ toissimulator.toisresultscollector.collectresults() in d:\pi2\thirdparty\tcc_new\tccmediator\toissimulator\toisresultscollector.cs:line 101 innerexception: system.invalidoperatio...

javascript - On a chessboard, one piece shoots another with a gun, how can I tell if any other pieces are in the crossfire? -

javascript - On a chessboard, one piece shoots another with a gun, how can I tell if any other pieces are in the crossfire? - basically have grid of spans resembling chess/checker board players & ai taking turns moving. during players turn, can "shoot" other players, i'm having hard time getting head around how tell if there in crossfire. i consider "chess piece" occupying square taking entire square, need way find out if "bullet" passes through square travels point point b. here brief example: http://jsfiddle.net/hnxs4cvq/9/ javascript/jquery: $(window).load(function(){ $(function () { $('.skillrangesquare').click(function () {alert('hit!');}) }) }); html: <span id="1" class="battlefieldsquare_base battlefieldsquare_b " name="r1c1"> &nbsp;</span> <span id="2" class="battlefieldsquare_base battlefieldsquare_a skillrangesquare" name=...

asp.net mvc - Issue using MVC 4 in Mono Framework -

asp.net mvc - Issue using MVC 4 in Mono Framework - i using debian host application built using mvc. using mariadb backend. application works fine in windows platform when seek run on linux using mono framework generates next error. system.io.filenotfoundexception exception origin: dotnetopenauth.core i using next versions: mvc 4 mono 3.2.3 is there compatibility issue or missing something? found solution myself add together reference log4net.dll asp.net-mvc mono

c - Why can't gsl_vector_alloc be called before main starts? -

c - Why can't gsl_vector_alloc be called before main starts? - from 21st century c book: static variables, within of function, initialized when programme starts, before main, can’t initialize them nonconstant value. //this fails: can't phone call gsl_vector_alloc() before main() starts static gsl_vector *scratch = gsl_vector_alloc(20); why can't gsl_vector_alloc called before main starts? what quoted book answer, i.e. because wouldn't compliant c standard. all expressions in initializer object has static storage duration shall constant expressions or string literals. although believe possible in c++ under conditions. c static gsl

matlab - How can you tell if a given point is inside a STereoLithography (.stl) file object c++ -

matlab - How can you tell if a given point is inside a STereoLithography (.stl) file object c++ - i trying determine of point within polyhedron imported stereolithography (.stl) file. i'm wondering if there c++ solution/library in existence solves problem. i'm looking avoid shelling matlab solution the theory of problem simple, when go point outside have pass odd number of facings (triangles). some pseudo code vector3d tooutside { point, pointoutside }; // !!! how know point outside ?!? for_each(trianglelist, [&count, =tooutside](triangle& triangle) { if (intersect(triangle, tooutside) // fussiness edges , triangle points. ++count; } if (count %2 == 1) isinside = true; else isoutside = false; finding point outside polyhedron, find highest x,y,z , add together 1.0 them. pseudo prof [todo:link article more stiff prof] simple case box, if within box, there 1 intersection side if follow tooutside vector. if within polyhedr...

python - Pandas dataframe filiter out groups of small sizes -

python - Pandas dataframe filiter out groups of small sizes - i'm trying filter out groups of little sizes , filter function throws valueerror: negative dimensions not allowed. caan't post code it's specific , can't reproduce issue random set of data. have come across this? i've seen other post same error wasn't helpful as work-around i'm trying same thing filter groupby , apply doesn't work expected. suggestions? dff = pd.dataframe({'a': np.arange(8), 'b': list('aabbbbcc')}) dff['c'] = np.arange(8) def f(x): if len(x)>2: homecoming x else: homecoming none dff.groupby('b').apply(f) b b c 2 nan nan nan 3 nan nan ... b b c 2 2 b 2 3 3 b 3 4 4 b 4 5 ... c b c 2 nan nan nan 3 nan nan .....

Python 2.7: Get only the row from a list where a specific cell matches a value (date in my case) -

Python 2.7: Get only the row from a list where a specific cell matches a value (date in my case) - so want more "where , grouping clauses in sql" , code: print "task1 : " open('suivi-ls.csv') csvfile: nb_saisi = 0 nb_ged = 0 reader = csv.reader(csvfile) row in reader: if not all(row): go on cell in row: if cell.split(";")[4] == "saisie": nb_saisi += 1 nb_ged += 1 print " data_1 : ",nb_ged print " data_2 : ",nb_saisi print "_________________________" and ouput : task1 : data_1 : data_2 : knowing list after reading cvs file liks example: date1 | data1 | data2 | data3 | date2 | data1_2 | data2_2 | data3_2 | so want output like: task1 : date1 data_1 : data_2 : date2 data_1_2 : data_2_2 : i hope clear enough, please guys, can ...

Javascript not opening class specific links with out HTML href -

Javascript not opening class specific links with out HTML href - i running problem want links class = "okpop" open, links local html files called popupa.html , popupb.html. in order stop popup default open links using href made href undefined. there links nothing. want js code trigger popup window nil happening. html code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>popup windows</title> <!--[if lt ie 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <!-- script 9.4 - popups.html --> <!-- bullet 8: add together class --> <p><a href="javascript:undefined" class="okpop" id="b" target="popup">b link</a> (will open in new window.)</p> <p><a href="javascript:unde...

cluster analysis - Variable selection for k-means clustering -

cluster analysis - Variable selection for k-means clustering - i'm wondering if there methods selecting variables k-means algorithm. trying market segmentation using algorithm , have dataset dozens of potential variables. have results easy interpret, should limit number of variables max. 5-6. particularly interested in solutions can implemented in spss statistics or weka. also, there method/algorithm getting optimal number of variables clustering (i.e. how many of 'good' variables should use)? try factor analysis, should help. no. of factors utilize depend on number of variables having eigen value >= 1. after finding no of factors, utilize fa() function find loadings value , decide variables need maintain , discard. help in removing highly multicollinear variables. cluster-analysis data-mining weka k-means spss

Get HTTP Status using swift -

Get HTTP Status using swift - i sorry, haven't found reply question(( please, don't harsh, not professional programmer, maintain learning , hope 1 time able reply someone's question)) i trying http status of link (i sort of generating links depending on 1 database entries code, abcdef, maintain them in array , generate link sec database, www.blablabla.abcdef.net), can see whether page exists in database or not. i have written code, wrong. maybe it's question like: "what's wrong code?" on stack say, have show attempts of problem solving... i wish maintain swift, without additional modules or something, think nshttpurlresponse must enough, using somehow wrong. looking forwards help , replies)) var err: nserror! nsurlconnection.sendasynchronousrequest(request, queue: queue, completionhandler:{ (response: nsurlresponse?, data: nsdata!, error: err) -> void in if (err != nil) { allow httpstatus: n...

python - Binary Tree Traversal adding empty values to trees -

python - Binary Tree Traversal adding empty values to trees - i trying recursively traverse binary tree in preorder, inorder, , postorder. have homecoming list of specified traversal, code preorder traversal below: class emptyvalue: pass class binarytree: """binary tree class. attributes: - root (object): item stored @ root, or emptyvalue - left (binarytree): left subtree of binary tree - right (binarytree): right subtree of binary tree """ def __init__(self, root=emptyvalue): """ (binarytree, object) -> nonetype create new binary tree given root value, , no left or right subtrees. """ self.root = root # root value if self.is_empty(): # set left , right nothing, # because empty binary tree. self.left = none self.right = none else: # set left , right new empty t...

sql server - Does asp.net do any caching when checking for [Authorize(Roles = "Student")] -

sql server - Does asp.net do any caching when checking for [Authorize(Roles = "Student")] - i have method limit utilize people have role of "student". explore different ways of doing this. first know can decorate method this: [authorize(roles = "student")] if know role of "student" has roleid of 4 , if know user has userid of 2 then: is decoration of method more efficient allowing every user role , doing select against identity 2 database see if user 2 has roleid of 4 in aspnetuserroles table. as fyi using webapi asp.net identity 2.1 , token bearer authentication. users access through web browser front-end. if there no caching way switch on caching appreciate advice help advise me on how utilize if not enabled default. you can enable caching feature of role provider web.config using cacherolesincookie . see this link more details. alternately can override default role provider (see this link more details),...

Visual Studio 2013 Ultimate Installer Crash -

Visual Studio 2013 Ultimate Installer Crash - i'm trying install visual studio 2013 (over existing 2012 install) handful of different iso files, work on other people's machines. on mine, load vs installer splash screen (just says "visual studio" , nil else) 10-20 seconds, shows generic crash info window info : problem signature: problem event name: vssetup p1: vs_ultimate p2: 12.0.30723.00.00 p3: 12.0.30723 p4: install p5: unknown p6: crash: exception p7: 53a12268 p8: 2c0 p9: 25 os version: 6.1.7601.2.1.0.256.4 locale id: 1033 i same error no matter installer running (iso's came microsoft). tried running administrator , got same result. the event log has link install log file, has lots of verbose output stuff, these exceptions beingness thrown near end : [17cc:0e64][2014-10-27t12:53:27]i000: mux: non-applicable packages grouped selectable items: [17cc:0e64][2014-10-27t12:53:27]i000: mux: obse...

angularjs - Unknown provider in angular unit testing -

angularjs - Unknown provider in angular unit testing - i have controller: angular.module("controllers").controller("addcontroller", function($rootscope, $scope, $location, $timeout, $routeparams, todos, messagequeue) { // ... code }); and test: describe("addcontroller", function() { var ctrl; var scope; beforeeach(module('controllers')); beforeeach(inject(function($rootscope, $controller) { scope = $rootscope.$new(); ctrl = $controller('addcontroller', { $scope: scope }); })); it("should available", function() { expect(ctrl).not.tobe(undefined); }); }); karma says: error: [$injector:unpr] unknown provider: $routeparamsprovider <- $routeparams http://errors.angularjs.org/1.2.27-build.533+sha.c8c2386/$injector/unpr?p0=%24routeparamsprovider%20%3c-%20%24routeparams but in karma.config importing bower_components/angular-route/angular-route.js ....

r - missing output from foreach -

r - missing output from foreach - if create simple model, foreach returns every result way think should: m=function(i,j){data.frame(i=i,j=j)} > foreach(i=1:2, .combine='rbind') %:% foreach(j=1:2, .combine='rbind') %dopar%{ + m(i,j) + } j 1 1 1 2 1 2 3 2 1 4 2 2 but using more complicated function misses first loop: # loop through prediction model (in parallel) different parameters results = foreach(i=1:2, .combine='rbind') %:% foreach(j=1:2, .combine='rbind') %dopar%{ model(i,j) } > results j tpr fpr rj day 1 1 2 0 0.2127812 1.022387 wed oct 29 11:53:45 2014 2 2 1 0 0.2161888 1.023102 wed oct 29 11:54:41 2014 3 2 2 0 0.2127812 1.022387 wed oct 29 11:53:45 2014 you might assume function generating error when i=1,j=1, running function outside foreach loop gives result: > model(1,1) j tpr fpr rj day 1 1 1 0 0.2161888 1.023102 wed oct 29 12:30:31 ...

php - How to extend the MessageBag class in Laravel -

php - How to extend the MessageBag class in Laravel - i need edit add method in laravel 4 messagebag class. how can extend in laravel app , register utilize mymessagebag class instead of default messagebag class. use illuminate\support\messagebag; class mymessagebag extends messagebag { public function add($key, $message) { if ($this->isunique($key, $message)) { $this->messages[$key] = $message; } homecoming $this; } } have read this? http://laravel.com/docs/4.2/extending anyway, think can extend laravel core classes next these steps: create , register service provider add facade service provider, allow using static methods, , replace alias custom namespaced class maybe answers question (with code): laravel extend form class php laravel laravel-4

javascript - Output array to element classes -

javascript - Output array to element classes - i'm trying output json object different parts of html page using same classes. i'm importing json api when i've set info (via input fields) looks little bit this: { "trip": [ { // first object in trip-array "leg": [{ "tripid": "0", "origin": { "name": "new york", "time": "12:04" }, "destination": { "name": "albany", "time": "1:49" } },{ "tripid": "1", "origin": { "name": "albany", "time": "2:05" }, "de...

java - How to run a Common Apache Daemon Window Service on interval of 2 hours automatically -

java - How to run a Common Apache Daemon Window Service on interval of 2 hours automatically - i have installed windows service through common apache daemon service . installation batch file's code @echo off setlocal rem service names (make sure not clash existing service) rem set service_jvm=myservice set service_java=myservice rem location set mypath=c:\myservice\src\classes rem location of prunsrv set path_prunsrv=c:\myservice\src\bin set pr_logpath=c:\myservice\logs rem location of jarfile set path_jar=%mypath% rem allow prunsrv overridden if "%prunsrv%" == "" set prunsrv=%path_prunsrv%\myservice.exe rem install 2 services echo installing %service_jvm% %prunsrv% //ds//%service_jvm% %prunsrv% //is//%service_jvm% echo setting parameters %service_java% %prunsrv% //us//%service_jvm% --startup=auto --jvm=auto --stdoutput auto --stderror auto ^ --classpath=%path_jar%\myservice.jar ^ --startmode=jvm --startclass=webmuch.myservice --startmethod=main ...

How to convert Razor Page to String in Controller -

How to convert Razor Page to String in Controller - just want inquire on how convert whole razor page(.cshtml) string in controller. i have created action template below: public actionresult template() { homecoming view(); } and in page shows below: <div style="margin-left:auto; margin-right:auto; width: 940px"> <div class="logo"> <img src="/content/assets/img/logo.png" /> </div> <div class="dbox"> <label class="clabel">test1 # </label> <span>: value1</span><br> <label class="clabel">test2 </label> <span>: value2</span><br> <label class="clabel">test2 </label> <span>: value3</span><br> <label class="clabel">test3 : </label> <span>: value4</s...

iis - Published asp.net website not accessible in other system in same network -

iis - Published asp.net website not accessible in other system in same network - i have developed asp.net website , published in server.whereas works in server if give browser iis manager, , in server ( published scheme ) works perfect.but need access same published application in other systems ( connected in same network ). how possible..?? note: 1. used iis 7. when tried connect scheme same networ getting error follows the socket connection 172.31.7.243 failed. errorcode: 10060.a connection effort failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond 172.31.7.243:90 if accessing application on hosted server replace localhost ipaddress of hosted server access on network [localhost]/myprojectname then this: [ipaddress_of_hostedserver]/myprojectname asp.net iis iis-7 website iis-manager

javascript - How can I make 3 boxes next to each other in my specific case? -

javascript - How can I make 3 boxes next to each other in my specific case? - i want place 3 boxes next each other. box may have text within , image covering @ left 50% of each box. you may wonder why asking here there lot of help elsewhere online. reason it's not working in particular case. whenever create div box or paragraph, contents underneath breaks downwards (doesn't remain same set). if @ code find have line of code: <marquee behavior="alternate">we coming soon, please check later.</marquee> that marquee works fine, if create paragraph instead of (or wrapping paragraph div boxes) ordered lists under breaks downwards , set underneath each other. means box or paragraph can made, not allow other contents (under them) remain same. [hope able explain problem properly, if not :my apology] can see work live here though paste code here. attachment shows want set boxes. .html: <!doctype html> <html lang="en"...

vb.net - Catching ODP.NET exception using error codes -

vb.net - Catching ODP.NET exception using error codes - i working on application uses sqlbulkcopy , oraclebulkcopy . when seek insert records , records exist on sql server, throws exception grab below, , handle in way. grab ex sqlexception when ex.errorcode = -2146232060 however, not sure how grab exception on oraclebulkcopy comes error code: ora-26026 . this construction i'm trying use: seek 'code grab ex sqlexception when ex.errorcode = -2146232060 'handle sql grab ex oracleexception when ex.number = 26026 'handle oracle grab ex exception 'handle general errors end seek is there way? an oracleexception (microsoft implementation) has code property. can utilize match 26026 : if (ex.code == 26026) { ... } the oracle implementation of oracleexception has number property: if (ex.number == 26026) { ... } vb.net oracle

node.js - Heroku dynos not sharing the file system -

node.js - Heroku dynos not sharing the file system - my heroku web app has feature download images s3. works this: there 1 endpoint (a) request downloading array of images, returns task id. those images downloaded tmp heroku folder of app. , when images downloaded, zip file created. while images can still downloading, web client calls endpoint (b) task id point 1. sec endpoint checks how many images downloaded homecoming progress percentage. when zip created "returns" zip file , images downloaded. this approach worked fine in heroku 1 dyno. unfortunately, after scaling 2 dynos, have realised doesn't work anymore. reason dynos in heroku doesn't share same file system, , endpoint , b managed different dynos. therefore, dyno in endpoint b doesn't find file. is there easy way create approach work multiple dynos? if not, how should implement feature described? (downloading multiple images s3 in zip file) you create sec s3 bucket , force zip f...

mysql - Err 1292 - Truncated incorrect DOUBLE value -

mysql - Err 1292 - Truncated incorrect DOUBLE value - i have 2 tables: old: create table `users` ( `id` int(11) not null auto_increment, `crdate` int(11) default null, `fb_id` text, `email` varchar(64) default null, `fb_access_token` varchar(256) default null, `display_name` varchar(128) default null, `first_name` varchar(128) default null, `middle_name` varchar(128) default null, `last_name` varchar(128) default null, `gender` varchar(128) default null, `timezone` tinyint(4) default null, `locale` varchar(16) default null, `fb_profile_url` text, `balanced_id` text, `token` varchar(100) default null, `address_id` int(11) default null, `admin` tinyint(1) default '0', `zip` int(11) default null, primary key (`id`) ) engine=innodb default charset=latin1; new: create table if not exists `friendzy`.`users_new` ( `id` int(11) not null auto_increment, `email` varchar(64) null default null, `display_name` varchar(128) null def...

android-studio project git private folder -

android-studio project git private folder - i have android project i'm working on using android studio , git repository. want start working on separate files (graphic files) not part of app. later edit them , include them in app (things icons , background images). want include them in git repository somewhere. best place. thinking of putting them in folder @ root of git repository , giving descriptive name. there mutual way this? git/ personal/ app/ build/ gen/ gradle/ other-files is 'personal' want? maybe want 'assets' or 'personal-assets'. people commonly do? i nest them in assets under folder. don't know domain working in think descriptive possible best. create sure ignore directory in git if not want force files repo. git hub has link on how this. https://help.github.com/articles/ignoring-files/ android git android-studio

regex - How to embed all numbers within $ $ -

regex - How to embed all numbers within $ $ - i preparing thesis in latex. want embed of real numbers (numbers decimal points) in table environment within $ $. best approach so. there many tables , files saved in utf-8 encoding. example: \begin{table}[htbp] \caption{پایگاه داده‌ی نمونه استفاده شده در مثال \ref{ex:exp1}، (آ) پایگاه داده‌ی اصلی ، (ب) نسخه‌ی 3-بی نامی} \centering \begin{tabular}{|r|r|r|r|r|} \cline{1-2}\cline{4-5} 681.00 & 404.00 & & 327.55 & 280.92 \\ % % % \multicolumn{3}{c}{(آ)} & \multicolumn{2}{c}{(ب)} \end{tabular}% \label{tab:lf_3} \end{table} must changed to \begin{table}[htbp] \caption{پایگاه داده‌ی نمونه استفاده شده در مثال \ref{ex:exp1}، (آ) پایگاه داده‌ی اصلی ، (ب) نسخه‌ی 3-بی نامی} \centering \begin{tabular}{|r|r|r|r|r|} \cline{1-2}\cline{4-5} $681.00$ & $404.00$ & & $327.55$ & $280.92$ \\ % % % \multicolumn{3}{c}{(آ)} & \multicolumn{2}{c}{(ب)} \end{tabular}% \label{tab:...

php - How to sort records by relation field using relation fields column in Doctrine? -

php - How to sort records by relation field using relation fields column in Doctrine? - i have 2 entities in relation manytoone. scheduledevent , tariff entites. first entity scheduledevent field tariff tariff manytoone relation. , have configured in scheduledevent entity: /** * * @orm\manytoone(targetentity="tariff", inversedby="scheduledevents") * @orm\joincolumn(name="tariff_id", referencedcolumnname="id") **/ private $tariff; and tariff entity has 'name' , 'scheduledevents' fields set this: /** * @var string * * @orm\column(name="name", type="string", length=255) */ private $name; /** * * @orm\onetomany(targetentity="scheduledevent", mappedby="tariff") */ private $scheduledevents; is possible configure scheduledevent entity in annotaion or other way when select records scheduledevent entity sort tariffs name column. so illustration when build query this: ...

javascript - jQuery don't parse HTML -

javascript - jQuery don't parse HTML - i have string html elements, , i'm using jquery seek append string div: var content = '<div>test</div>'; $('div').append(content); is there way in javascript or jquery create doesn't parse string in div get: <div>test</div> instead of test you can utilize jquery .text() function set strings html elements. if utilize .html() function set test javascript jquery

javascript - Is attaching dependencies to a class an appropriate way to test? -

javascript - Is attaching dependencies to a class an appropriate way to test? - i'm struggling bit moving on tdd/bdd. have multiple methods rely on response external module in order perform responsibility. test these methods under different circumstances, instance if module responds info object or error. one way of doing attach external module class/module beingness tested properties , "stubbing" it. seems little dirty though, because end these other modules attached module. is appropriate way testing methods rely on response external module, or there improve way? should restructuring architecture in way create more tested? if how? here's illustration of mean: my-module.js var extmod = require('external-module'); var mymod = module.exports = function () { /* stuff */ }; mymod.prototype.extmod = extmod; mymod.prototype.somemethod = function () { this.extmod({ /* request */ }, function () { /* stuff */ }); }; mymodulesp...

table - Swift - using UITableView without a storyboard -

table - Swift - using UITableView without a storyboard - i'm trying set tableview subview in viewcontroller. without using storyboard! i'm trying code, doesn't seem work , can't understand why.. code in tableview should created func tableview(position: cgrect, allrecipes: [recipe]) -> uitableview { allow tableview: uitableview = uitableviewforallrecipes(style: uitableviewstyle.plain).tableview homecoming tableview; } . and tableviewcontroller (uitableviewforallrecipes) class uitableviewforallrecipes: uitableviewcontroller { override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { var cell: uitableviewcell = uitableviewcell(style: uitableviewcellstyle.default, reuseidentifier: "cell") cell.textlabel.text = "ok" homecoming cell } override func numberofsectionsintableview(tableview: uitableview) -> int { println("nosit") hom...

for loop - Java alternative code in Pascal -

for loop - Java alternative code in Pascal - just simple question dealing recently.. alternative of code in pascal? possible accomplish similar syntax? for (i=1; i<11; i++) { j= x*10; x= x+1; } the issue is, in loop assigning desired range operation (increment i) on same line. with pascal able do for i:=1 10 but then, 1 time within loop unable command variable involved in loop status (i). , produces different outcome. the for statements in java , pascal different. in java, in "curly brace languages" derived c, statement while loop in disguise: for (x; y; z) { p; } same thing x; while (y) { p; z; } (well, not same thing, there difference in scope of variables used). in pascal, for statement iterates on number of values known beforehand, much java's for each statement ( for (int : intarray) { ... } ). theoretically, there big difference in while loops , for loops: in while loop not case loop status ever false, loop forever. f...

Cant discard file changes in GIT -

Cant discard file changes in GIT - i faced problem, can't discard changes file. in diff showed lines deleted , new pasted. content of file similar initial commit in branch. intellij thought shows there no diff repository. i new 1 git, please patient) my best guess happening on windows machine, , somewhere in .gitattributes file have directive tells git perform line ending normalizations (via * text=auto or similar). if indeed case, when checkout file lfs converted crlfs, , when commit file crlfs converted lfs. if indeed case, happening repository version of files in question somehow have crlfs in them. when check them out, working copies of course of study have crlfs. here's rub: when doing git status , git diff , etc. git compares in repo/index not in working directory, would committed after line ending normalization done, i.e. crlfs replaced lfs. in case, git sees in index/repo has crlfs, , would commit has lfs, , there difference. to see if case, run n...

windows - How do I find current directory for my Batch file? -

windows - How do I find current directory for my Batch file? - i working on batch file (let's phone call temp.bat). trying move batch file desktop, can't find batch file location / directory. asking if there extension or can utilize automatically identify directory, instead of entering every time. in other words, can still move file place in directory. example: temp.bat on downloads file. utilize move command move file desktop. temp.bat on documents file. seek utilize same command move file desktop. is there parameter extensions it? this have now: @echo off move /y [the directory of temp.bat] c:\users\69swag\desktop all answers appreciated! :) you don't need current directory move file. move temp.bat c:\users\69swag\desktop if still want current directory, utilize this: echo %cd% windows batch-file

javascript - Jquery Ajax Inserting data into a database -

javascript - Jquery Ajax Inserting data into a database - i have page 3 forms, , on these forms seperate variables. page allows user come in details , inserted mysqldatabase viewing. have script: edit: know mysql_ deprecated sake of illustration it's working fine. edit 2: know can inject that's pretty irrelevant @ moment, think it's problem using text area instead of simple input. edit 3: it's typo (fuck sake). it's been long day $("#finishbutton").click(function(e) { // store final value , execute script insert db. on success, switch success page var commentsvalid = $('#commentsdetailsform').valid(); if (commentsvalid) { comments = document.getelementbyid('commentsinput').value; e.preventdefault(); $.ajax({ type: "post", url: 'insert.php', data: 'forenameinput=' + forename + '&surnameinput=' + surna...