Posts

Showing posts from April, 2015

count - C++ divide a number to display at most 60 chars for different rolls of a dice -

i told roll die large number of times (a few thousand) @ first once record amount of times each value occurs , create makeshift histogram displaying x roll of number, e.g. rolling 3 1 's, 2 2 's, , 5 3 's might this: 1 xxx 2 xx 3 xxxxx what trying find way divide x's @ 60 x's appear next number. i have 2 instances, rolling single die recording 1-6, , 2 dice , recording sum in range 2-12 (11 values). originally tried divide number of rolls 360 (6 possible values 1 die, 60 total xs) number of occurrences each x represented taking count roll (say rolled 1 2047 times) , dividing value if rolled dice 12000 times value of each x 12000/360 = 33 (the .3333 dropped due integer division) display 2047 / 33 x's yields 62. anyone have better way this? i tried 11*60 2 dice approach , way off. this sounds homework, here's hint: figure out largest value need display is, use along maximum length display (60) ratio calculate length of each line of ou

php - Displaying image directly in browser using zend framework -

i trying display image using zend framework in directly browser. can display png format. here code works fine when try access png image , displays image in browser. // disable layout $this->_helper->layout->disablelayout(); $file = 'http://framework.zend.com/images/poweredby_zf_4lightbg.png'; $logo = file_get_contents($file); $type = 'image/png'; $response = $this->getfrontcontroller()->getresponse(); $response->setheader('content-type', $type, true); $response->setheader('content-length', count($logo), true); $response->setheader('content-transfer-encoding', 'binary', true); $response->setheader('cache-control', 'max-age=3600, must-revalidate', true); $response->setbody($logo); $response->sendresponse(); exit; again: above code works fine , displays image in browser correctly when try jpeg/jpg image give me message: the image “ http://localhost/zfproject/activity/share

python - What is wrong with my string format? (Even WITH the trailing comma in the parameter) -

first tried: sqlite3.cursor.execute("select * mytable mycol=?", (myval,)) when execute in shell works. in class method tells me: programmingerror: incorrect number of bindings supplied. current statement uses 0, , there 12 supplied. then tried: sqlite3.cursor.execute("select * mytable mycol='%s'" % myval) when execute in shell works. in class method tells me: programmingerror: incorrect number of bindings supplied. current statement uses 0, , there 12 supplied. so decided format string first , pass in. this: sqlcmd = "select * mytable mycol='%s'" % myval when execute in shell works. in class method tells me same error: programmingerror: incorrect number of bindings supplied. current statement uses 0, , there 12 supplied. my method defined this: def mymethod(self, myval): cur = self.conn.cursor() cur.execute( "..." ... ) .... what missing? this "know tools" problem. ment

asp.net - The name 'model' does not exist in current context - Only on one page at one variable -

so "the name 'model' not exist in current context" error pretty common. however, might have different kind of cause. in view use multiple model.variablename variables. on 1 line doesn't work: @html.passwordfor(model => model.pw, new { @value = model.pw}) as were @html.textboxfor(model => model.email) just works. i've tried many, if not all, possible solutions. nothing worked. however, exclude here's part webconfig (main): <appsettings> <add key="webpages:version" value="3.0.0.0" /> <add key="webpages:enabled" value="false" /> </appsettings> and webconfig in views folder: <configuration> <configsections> <sectiongroup name="system.web.webpages.razor" type="system.web.webpages.razor.configuration.razorwebsectiongroup, system.web.webpages.razor, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35">

c# - Unity 5.2 compile error "Assertion ... not met" -

i relatively new unity (about 3 months) , upgraded 5.2 , have been using visual studio couple weeks without issue. today getting error: * assertion @ ..\mono\metadata\class.c:1423, condition `*sig == 0x06' not met in visual studio, compiles fine. have tried "clean solution", "rebuild solution", , "build solution" in visual studio , comes "build succeeded". when switch unity assertion problem , tells me fix compile errors. i tried exiting , rebooting. no luck. know happening? well new version of unity released 5.2.1f1 , when installed problem went away. not sure if uninstalling , re-installing old version have fixed problem.

mysql - connect remote sql (c languange) -

i cant connect remote mysql server. after running code use gcc, there undefined reference mysql administrator@el6116-1:~$ gcc pilihan.c -o pilihan /tmp/cc4uqv0f.o: in function `main': pilihan.c:(.text+0x67): undefined reference mysql_init' pilihan.c:(.text+0xe1): undefined reference mysql_real_connect' pilihan.c:(.text+0xf6): undefined reference mysql_error' pilihan.c:(.text+0x135): undefined reference mysql_query' pilihan.c:(.text+0x145): undefined reference mysql_error' pilihan.c:(.text+0x177): undefined reference mysql_use_result' pilihan.c:(.text+0x1c2): undefined reference mysql_fetch_row' pilihan.c:(.text+0x1d9): undefined reference mysql_free_result' pilihan.c:(.text+0x1e5): undefined reference mysql_close' collect2: error: ld returned 1 exit status and here code in c: #include <stdio.h> #include <mysql/mysql.h> #include <stdlib.h> void dataa() { printf( "datanas

android - Have trouble with app-debug.apk when app-debug-unaligned.apk is not -

i developing nfc-integrated android application using android studio. i have 2 activities: 1 nfc tag reader , other nfc tag writer. works fine (reader/writer) when run app in phone. after that, went workspace\app\build\outputs\apk , see 2 apks here app-debug.apk | app-debug-unaligned.apk . i saw topic said app-debug complete app. when install app-debug.apk nfc tag writer not work. i removed , installed app-debug-unaligned.apk , apk worked perfectly. i tried find on google nothing found. has idea this? please tell me part of code should shown here review. p.s. : tried adding keystroke nfc tag writer still not work.

java - How find/invoke appropriate handler for interface implementation? -

suppose there interface several implementations: //methods , implementations omitted public interface myrequest {} and several handlers extended interface: public <t extends myrequest> inteface handler<> { myresult handle(t request) } public xmlhandler implements handler<xmlrequest> { @override myresult handle(xmlrequest request) { //... } } public jsonhandler implements handler<jsonrequest> { @override myresult handle(jsonrequest request) { //... } } up clear, problem that, when requests parsed parser returns interface: public void somemethod () { xmlhandler xmlhandler = ... jsonhandler jsonhandler = ... myparser parser = ... myrequest request = parser.parse(someobejct); if (request instanceof jsonrequest) { jsonhandler.handle(request); } if (request instanceof xmlrequest) { xmlhandler.handle(request); } } instanceof bad here. how avoid this? m

c# - How to check whether a SemaphoreSlim can be entered? -

i want assign list of objects in semaphoreslim fashion, e.g. suppose each object can used 2 threads @ same time. plan create semaphoreslim class each object in list, question how should check whether semaphoreslim can used right now? i don't want call wait() since if object not available can move on next 1 in list. don't want check currentcount property either since don't think thread safe if multiple threads checked currentcount @ same time , decided call wait() if currentcount larger zero. so ideal solution scenario? btw - can use other solutions - not semaphoreslim. i suspect can use wait(timespan.zero) "try acquire semaphore, abandon attempt if can't immediately." that expectation, documentation doesn't explicitly talk happens if pass in timespan.zero . it's worth @ least investigating option further, imo.

node.js - Mongoose: find with multi condition -

i studying node.js. have problem. have created new model - "adventuremodel". , want search data multi condition. code following: adventuremodel.find({ $and : [{ name : new regexp(name, 'i'), description : new regexp(description, 'i'), tags : { $in : tags } }]}, function (err, adventures) {}); but not works fine. how can find multi condition @ same time? please me. regards.

swift2 - Swift 2 Syntax Error -

so, tells me: init() deprecated in ios 9.0: use - initwithconcurrencytype : instead var managedobjectcontext = nsmanagedobjectcontext() that's code. gave error too, how should change it? since ios 9 nsmanagedobjectcontext() deprecated , recommended create nsmanagedobjectcontext with, hinted, -initwithconcurrencytype: instead. usage when creating nsmanagedobjectcontext in ios 9: let managedobjectcontext = nsmanagedobjectcontext(concurrencytype: .mainqueueconcurrencytype) with -initwithconcurrencytype: , need specify concurrency type. the above example creates 1 .mainqueueconcurrencytype , 1 of 3 1 can specify: case confinementconcurrencytype specifies context use thread confinement pattern. case privatequeueconcurrencytype specifies context associated private dispatch queue. case mainqueueconcurrencytype specifies context associated main queue. with deprecated nsmanagedobjectcontext() , if memory serves, default of type

How to remove extra rows and columns with NA values when importing from csv file using R -

i have started learning r. i'm trying input data .csv file , r keeps adding rows , columns na values. know why might happening? advice on removing these na appreciated. have used following code: >no_col <- max(count.fields("6%aa_comp.csv", sep=",")) >mydata <- read.csv(file="6%aa_comp.csv", fill=true, header=true, col.names = 1:no_col-1) >mydata x0 x1 x2 x3 x4 1 206428 152160 122080 111940 na 2 183620 148300 118820 107260 na 3 169100 164480 151420 146200 na 4 179000 135920 107340 93540 na 5 213820 146640 113040 109140 na 6 150920 141400 133600 132000 na 7 185645 154000 124510 128900 na 8 176102 139100 141000 110300 na 9 159045 154350 121050 153500 na 10 198610 161000 119000 105600 na 11 183100 138900 141500 129550 na 12 211050 142550 136700 113500 na 13 167000 150100 120000 102540 na 14 na na na na na 15 na na na na na 16 na na na na na well, data clea

android - Dialog: Overflowing ScrollView Content -

newbie android developer here. have layout dialog: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/llparent" android:layout_width="match_parent" android:layout_height="wrap_content"> <scrollview android:id="@+id/svchild" android:layout_width="match_parent" android:layout_height="wrap_content"> ... content goes here </scrollview> <button android:id="@+id/btncancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@id/svchild" android:text="cancel"/> <button android:id="@+id/btnok" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom

javascript - Jade - subsequent lines becoming children of included partial? -

i having issues simple jade layout, example: include test.jade #bar hi and in test.jade #foo hello and no matter what, #bar rendered child of #foo . <div id="foo">hello <div id="bar">hi</div> </div> when trying achieve <div id="foo">hello</div> <div id="bar">hi</div> i'm confused if i'm doing wrong or if intended behaviour of jade? i building jade templates brunch , static-jade-brunch i'm not sure if problem lies or if missing something? hm, okay, i'm not sure if right solution, found had wrap include in block: block test include test.jade #foo hello and have desired output.

Android google map icon marker with just color white -

Image
im using google maps in android project, , im having problem. my icon not show correct color of image, white icon i take screenshot of app map icon in center of screen... the original color yellow, show white. follow code googlemap.addmarker(new markeroptions() .title(lista.get(i).getnome()) .snippet("") .position(lista.get(i).getlatlng()) .alpha(lista.get(i).getid()) .icon(bitmapdescriptorfactory.fromresource(r.drawable.ic_mapaok1)) ); anyone can help? android lollipop version doesn't support icon format. changes white background of image white , not in form of silhouette icon, hence appearing white. refer following links create icon: http://appicontemplate.com/android-product-icons/ http://andr

android - Can't get the hour and minute from TimePicker -

i take time gui control 'timepicker' , try set time on object type 'calendar' intent ( used serializable ). on method 'public void donebtnclickevent(view view) ' exception on line '_calendar.set(calendar.hour, _timepicker.gethour());' i don't understand did wrong , how solve problem. public class settimeactivicy extends appcompatactivity { private timepicker _timepicker; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_set_time_activicy); _timepicker = (timepicker)findviewbyid(r.id.timepicker); _timepicker.setis24hourview(true); } public void donebtnclickevent(view view) { try { // exception !! => cant take hour , min int h = _timepicker.gethour(); int m = _timepicker.getminute(); } catch(exception e) { log.e("exception - error ", e.getmessage()); } } }

php - Laravel Mail attach binary data -

is there way attach binary data file? \mail::send('test', [], function ($message) { $message->to('xxxxxx.@xx.com', 'x x')->subject('test'); $message->attach($file_binary_data); }); i have checked this, email didn't send. gave blank page no errors. 1, mail api based drivers such mailgun , mandrill simpler , faster smtp servers. should register mailgun or mandrill account firstly, or use mail smtp (you can smtp info in email settings) 2, 'test' view file must exist in 'resources/views' directory. 3, $file_binary_data must exist in local file system.

java - is it good idea to use WeakReference for local reference ? -

right working on 1 java application. in creating lots of method local objects . using weakreference create objects in method below. public void method() { while(count < 10000000) { animalbean animal = new weakreference<animalbean>(new animalbean()).get(); //----------- here logic ------------- } } i have 1 doubts, idea use weakreference local variables ? if no why ? thanks lot in advance. here guide understand weak reference you should think using 1 whenever need reference object, don't want reference protect object garbage collector. classic example cache want garbage collected when memory usage gets high (often implemented weakhashmap). ref weak reference objects, not prevent referents being made finalizable, finalized, , reclaimed. weak references used implement canonicalizing mappings. suppose garbage collector determines @ point in time object weakly reachable. @ time atomically clear weak references object , weak refer

Same function needs to be called simultaneously for all users in php -

i have start_processing("set 1") function takes 6 hrs complete set1, i want process set 2, set 3 .... how can process of them in same time ?? since when put <?php start_processing("set1"); start_processing("set2"); start_processing("set3"); ?> it takes 18 hrs. i want complete process in 6hrs processing. finally got solution i have take curl_multi - far better. save handshakes - not needed every time! use curl_multi_init run processes in parallel. can have tremendous effect. unless using php apache-module, can use pcntl_fork create several processes of each processes 1 function call. if(pcntl_fork()) start_processing("set1"); else if(pcntl_fork()) start_processing("set2"); else start_processing("set3"); if have varying number of working sets, put them in array , loop through it. bear in mind many processes overload system! another, more lightweight, option use of

Android get Status Bar Height giving java.lang.ExceptionInInitializerError -

additional information (the original question below) after following @ρяσѕρєяk advice in comments section, getting same error on file ( sizenotifierrelativelayout.java ) , error occurs @ line 44, super.onlayout(changed, l, t, r, b); . code file , logcat follows: sizenotifierrelativelayout.java package com.app.name.widgets; import android.content.context; import android.graphics.rect; import android.view.view; import android.widget.relativelayout; import com.app.name.androidutilities; public class sizenotifierrelativelayout extends relativelayout { private rect rect = new rect(); public sizenotifierrelativelayoutdelegate delegate; public abstract interface sizenotifierrelativelayoutdelegate { public abstract void onsizechanged(int keyboardheight); } public sizenotifierrelativelayout(context context) { super(context); } public sizenotifierrelativelayout(context context, android.util.attributeset attrs) { super(context,

amazon web services - Domain name not showing up in DNS -

Image
it's been couple of days transferred domain name 1 aws another--dev environment production. problem is, domain name isn't showing in dns (amazon or google). i'm pretty sure i've configured hosted zone correctly. i'm trying verify ses failing , set mx records (gmail) don't work. mx records , ses set couple of days ago. additionally, created record point elastic load balancer dns name. any suggestions on might problem? it's been couple of days , past stackoverflow posts past experience, dns propagation on amazon's server doesn't take more 15 minutes. edit: here timeline of events can provide more information: i had domain abc.com on aws account user1 the domain transfered aws account user2 as of right now, following hosted zone created on user2 's account: the 1 thing record set missing cname load balancer had setup when domain belonged user1 . understanding record should enough , mistake on part. i'm using windows , i&#

c++ - design headache with unique_ptr -

say have class foo : class foo { public: ... }; foo has instance method either transforms foo instance foo instance, or returns same foo instance: <some appropriate pointer type foo> foo::trytotransform() { if (canbetransformed()) { <delete foo instance>; return <new instance of foo>; } else { return <this instance of foo>; } } client code: <some appropriate pointer type foo> foo = ...; ... foo = foo->trytotransform(); this easy naked pointers: foo* foo::trytotransform() { if (canbetransformed()) { delete this; return new foo(...); } else { return this; } } foo* foo = ...; ... foo = foo->trytotransform(); but if client code uses unique_ptr instead of naked pointer? is, ideally client code this: unique_ptr<foo> foo = ...; ... foo = foo->trytotransform(); how should foo::trytotransform() defined in order enable such (or similar) client code? because trytotransfor

kleene star - If language L is not regular, is L* regular? -

it makes sense assume l* not regular. however, cannot find proof of either conclusion. not necessarily, possibly. l 0, 1, 01, 0011, 000111, 00001111, etc. l not regular, l* [01]* .

Where is the Excel Object Library file -

i'm looking excel object library file import labview. have ms office 2013 installed , can find msacc.olb, msoutl.olb, msppt.olb, , msword.olb can't figure out file (.olb or .dll) import in order manipulate excel files in labview. the excel team differently. excel object library executable: c:\program files (x86)\microsoft office\office15\excel.exe

javascript - Displaying Ajax Sample Results as the Form Loads -

i've set box display results ajax form, showing water data geological survey , using google chart. works great, want users see sample results when first load form instead of empty box. not sure how it. here's code form: <table bgcolor="tan" width="480px" height="450px"><tr><td> <h2>current river levels</h2></td><td> <form> <select name="users"; onchange="showuser(this.value); drawchart(this.value)";> <option value="01598500">north branch @ luke, md</option> <option value="01603000">north branch @ cumberland, md</option> <option value="01610000">potomac river @ paw paw, wv</option> <option value="01613000">potomac river @ hancock, md</option> <option value="01619500">antietam creek @ sharpsburg, md</option> <option value="01638500">potomac river

sql - Stored Procedure to update table incredibly slow. Why? -

i have simple stored procedure takes bunch of parameters update existing record within table. creating , deleting record other stored procs takes little time execute. however, executing update stored proc takes 60 seconds , can't fathom why. i've tried proposals article, without luck: sql server: query fast, slow procedure here original sp: create procedure [dbo].sp_update @ownerid uniqueidentifier, @dealid uniqueidentifier, @title nvarchar(250), @description nvarchar(max), @projectvalue money, @country nvarchar(250), @countryregion nvarchar(max), @worldregion nvarchar(250), @marketsector nvarchar(250), @projectstage nvarchar(250), @creationdate datetime, @expirydate datetime, @imagefilepath nvarchar(max), @isactive bit, @isdeleted bit begin update sometable set ownerid = @ownerid, title = @title, description = @description,

javascript - how to refresh more than one div using jquery -

i have jsp page on when click on image image changed another.now want effect of 1 user changes must reflect users @ same time access website without refreshing entire page here code............... <html> <title>java web starter application</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="style.css" /> <head> <title>manage objects</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script> $(document).ready(function() { loadbulbdata(); }); //bulbstatus function loadbulbdata() { $('#main').load('index.jsp', function() { //alert('inside refresh method'); reloaddata = window.settimeout(loadbulbdata, 20000)

python - How can you dynamically create variables via a while loop? -

this question has answer here: how create variable number of variables? 12 answers i want create variables dynamically via while loop in python. have creative means of doing this? unless there overwhelming need create mess of variable names, use dictionary, can dynamically create key names , associate value each. a = {} k = 0 while k < 10: <dynamically create key> key = ... <calculate value> value = ... a[key] = value k += 1 there interesting data structures in new 'collections' module might applicable: http://docs.python.org/dev/library/collections.html

mysql - PHP variable looses value -

have report showing query output invoicing clients @ feedyard. queries produce blank page, instead of r1 or r3 layout came variable query. finally figured out if statement choose report layout not receiving value. questions here , other forums involved passing variable across pages or methods when lost value, next line. echoed variable right before if statement , shows r1, in next line variable not equal r1. (i moving pdo connection, client waited until harvest in full swing ask formula/input changes , new reports, closed system on network.) $theq query correct syntax, generates right answer, i'm starting code block @ $report variable set, showing code until $report isn't same value... if ($getticketsfetch['highmoisture'] === "r2") { $report = "r1"; } else { $report = $getticketsfetch['highmoisture']; } if (mysql_numrows($gettickets) < 1) { echo 'no tickets report on parameters, please go , `try again ';

c# - Why can't I use the modal dialog (child window / top level window) in XBAP application? -

i have xbap application , wanted understand why can't use modal windows (child/ top level window) in spite of full trust mode in other words, why showdialog method asynchronously called when used in xbap? thanks answer. the showdialog method in xbap asynchronous - means returns , shows modal window (it works in silverlight). in wpf desktop application method synchronous - behavior comes standard window control. window shown when call showdialog method still modal, no matter shown asynchronously. there work around that, didn't liked tho : how implement modal dialog xbap

java - How to remove extra commas in my string? -

here code storing in string , reading list: arraylist<string> list = new arraylist<string>(); list.add("one"); list.add("two"); list.add("three"); string liststring = ""; (string s : list) { liststring += s + ", "; } system.out.println(liststring); it adding comma @ end, how can remove , code in minimum number of lines. please help! java 8 has nice new stringjoiner class made this... arraylist<string> list = new arraylist<string>(); list.add("one"); list.add("two"); list.add("three"); string liststring = ""; stringjoiner sj = new stringjoiner(", "); (string s : list) { sj.add(s); } liststring = sj.tostring(); system.out.println(liststring); which outputs one, two, 3 if you're not lucky enough using java 8 (and feel pain), use stringbuilder , delete last 2 characters end, like... arraylist<string> list = new arrayl

r - How can I generate CDdiagrams using Python/rpy2 -

Image
i want generate graph similar this: i know api can generate similar diagram, doesn't use matrix or vectors, object same r package. https://cran.r-project.org/web/packages/performanceestimation/performanceestimation.pdf ## not run: ## estimating mse 3 variants of both ## regression trees , svms, on 2 data sets, using 1 repetition ## of 10-fold cv library(e1071) data(iris) data(satellite,package="mlbench") data(letterrecognition,package="mlbench") ## running estimation experiment res <- performanceestimation( c(predtask(species ~ .,iris), predtask(classes ~ .,satellite,"sat"), predtask(lettr ~ .,letterrecognition,"letter")), workflowvariants(learner="svm", learner.pars=list(cost=1:4,gamma=c(0.1,0.01))), estimationtask(metrics=c("err","acc"),method=cv())) ## checking top performers topperformers(res) ## let assume choose "svm.v2"

Ruby on Rails:Reload a View Inside other -

i has 2 views named _show.html.erb , index.html.erb . _show.html.erb rendered inside index.html.erb . want reload _show.html.erb part inside index.html.erb . when dropdown selected. tests/_show.html.erb file: <div class="main_content" > <% @tests.each |x| %> <%# if x.name == @str %> <p>here <%= x.name %> rating in programming languages</p> <% x.languages.each |a,b| %> <%= %> <strong> : </strong> <%= b*10 %></br> <% end %> <p>state: <strong><%=x.state%></strong></p> <%# end %> <% end %> </div> tests/index.html.erb file: <p>find me in app/views/tests/index.html.erb</p> <%= select_tag :name,options_for_select(@tests.map{|u| [u.name]}.uniq), remote: true, id: "update_select" %> <% @str = "<span id=\"product-modal\">ashrith&

gradle - How do I copy a file into my WAR based on profile? -

i’m using gradle 2.7 on mac yosemite. have following files: src/main/environment/dev/context.xml src/main/environment/qa/context.xml src/main/environment/prod/context.xml what if run build gradle -pqa build , appropriate context.xml file above copied war (into web-inf/classes directory fine). how set gradle? there're many ways of solving problem. can configure sourcesets , or include or exclude particular resources when building war file. can have single context.xml , perform resource filtering replacetokens filter. i've chosen sourcesets : apply plugin: 'war' ext.env = project.hasproperty('env') ? project.env : 'dev' sourcesets { main { resources { srcdir "src/main/environment/$env" } } } the trick include/process env being passed. if no env passed dev picked further processing. have demo .

ruby - Rails : ExecJS::ProgramError: RangeError: Maximum call stack size exceeded -

when compile asset run project on env=production rails_env=production bundle exec rake assets:precompile error : execjs::programerror: rangeerror: maximum call stack size exceeded (in /home/kop/rails/donghoxteen/vendor/assets/javascripts/spree/frontend/all.js) token ((execjs)) skip_line_comment ((execjs):2359:14462) handle_slash ((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) handle_slash ((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) handle_slash ((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) handle_slash ((execjs):2359:16320) next_token ((execjs):2359:17382) skip_line_comment ((execjs):2359:14521) handle_slash ((execjs):2359:16320) /home/kop/.rvm/gems/ruby-2.1.4

ruby on rails 3 - How to use the search in acts as taggable -

i using acts-as-taggable-on gem. i want use search both name tags in single search field my model class user < activerecord::base acts_as_taggable attr_accessor: :name, :age, :country, tag_list def self.search(search) if search where('name ?', "%#{search}%") else scoped end end end controller class userappscontroller < applicationcontroller def index @users = user.search(params[:search]) //@users = user.tagged_with(params[:search]) end end help me solve this. one way add both results 1 using + : @users = user.search(params[:search]) @users = @users + user.tagged_with(params[:search]) a better solution change search method in model return full result: where('name ?', "%#{search}%") + tagged_with(search) but if want split name search tag search, can split them scopes or , use it: scope :name_contains, -> (query) { where('name ?', "%#{query}%")

visual studio - In VisualSVN is it possible to ignore project folders that don't belong to a solution in update operation -

we have directory structure includes our company's projects under single root directory. our visual studio solutions located in root directory common projects can shared between solutions without having manage multiple copies them. unfortunately, when user tries perform update operation on solution working on, update of project files located in folders below solution file directory means changed files in projects if not relevant @ all. takes lot of time , clutters users' local drives unnecessary files. know if there method in visualsvn/tortoisesvn ignore file/folder/project not part of specific visual studio solution? thank time.

java - Spring WS: Add custom SOAP header -

what's goal? i'm rather new spring ws, got wsdl (and along xsds, ofcourse) , want add custom header elements soap response. i've been searching web, tried various code pieces, it's without luck... nothing seems work . what's problem? the response soap message has body spring calls payload , soap client (soapui) receives response rather well. here comes: how should add new (custom) soap headers response message? what's response xml expected? <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:header> <aud:headerinfo xmlns:bd="http://www.myws.com/"> <bd:id>123</bd:id> <bd:type>text</bd:type> </aud:headerinfo> </soap-env:header> <soap-env:body> <ne:myws xmlns:ne="http://www.iways.com/"> <ne:info> <ne:name>john</ne:name> <ne:designation>ita</ne:de

php - Showing Error: mysqli::real_connect(): (28000/1045): Access denied for user 'user'@'192.188.145.163' (using password: YES) -

this codeigniter project. given database information right.it works in localhost. after uploading project in hosting site, still shows 'access denied' error. this database: $db['default'] = array( 'dsn' => '', 'hostname' => 'telihatyhighschool.edu.bd', 'username' => 'db_username', 'password' => 'db_password', 'database' => 'db_name', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => false, 'db_debug' => true, 'cache_on' => false, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => false, 'compress' => false, 'stricton' => false, 'failover' => array() ,

OpenWrt UDP Socket stops working after some time - PHP uHTTPd -

i installed openwrt in router implementing home automation. using php uhttpd server. udp packets generated php stops working after time php not throwing errors. tried restarting uhttpd , php, not solving issue. but when unplug , plug network cable of target device, again starts working. this problem occurs when send packets openwrt, working fine when send packets laptop.

java - Eclipse, running instances sequentially, one after another -

i have robot simulation run many times in order collect statistics. in particular, want run simulation 1,2,...,10 robots, , each of them must run 30 times, thought pass desired number of robots via main args . since simulation memory-intensive, want run them sequentially, 1 after another(otherwise outofmemory exception likely). working in java/eclipse, , under run configurations 1 can specify arguments passed program if called shell, haven't found way automate process. in short, following: for i=1 10: j=1 30: run simulation_instance(i) each run of program has independent. have tried using launch group option , way less configurable. are aware of other alternative? there is* way in eclipse, using eclipse ease. new , still in incubation. allows describe. the basic steps install eclipse ease , write javascript looks little like: // load launch module loadmodule("/system/launch") // logic loops/etc (i = 0; < 30; i++) { l = launch(&qu