Posts

Showing posts from May, 2012

bash - Finding multiple files recursively and renaming in linux -

i having files a_dbg.txt, b_dbg.txt ... in suse 10 system. want write bash shell script should rename these files removing "_dbg" them. google suggested me use rename command. executed command rename _dbg.txt .txt *dbg* on current_folder my actual current_folder contains below files. current_folder/a_dbg.txt current_folder/b_dbg.txt current_folder/xx/c_dbg.txt current_folder/yy/d_dbg.txt after executing rename command, current_folder/a.txt current_folder/b.txt current_folder/xx/c_dbg.txt current_folder/yy/d_dbg.txt its not doing recursively, how make command rename files in subdirectories. xx , yy having many subdirectories name unpredictable. , current_folder having other files also. you can use find find matching files recursively: $ find . -iname "*dbg*" -exec rename _dbg.txt .txt '{}' \; edit: '{}' , \; are? the -exec argument makes find execute rename every matching file found. '{}' replac

apache - BIRT behind a proxy on a Tomcat Server: Sessoin expired -

i'm trieing run eclipse birt on tomcat6 server behind proxy. scenario this: request @ pc url www.webseite.de/client/birt-viewer/.... pc redirects url another, special 1 client. on sever apache proxypass rules redirects request birt this: proxypass /client/birt-viewer http://localhost:8008/client/birt-viewer proxypassreverse /client/birt-viewer http://localhost:8008/client/birt-viewer the next thing changes in in server.xml part of following <host name="localhost/client" appbase="webapps" unpackwars="true" autodeploy="true" xmlvalidation="false" xmlnamespaceaware="false"> now possible birt-viewer expample, everytime determines following error message: "the viewing session not available or has expired." what have change, birt run corretly? okay got it. problem cookie. added following line in http.conf proxypassreversecookiepath /birt-viewer /client/birt-view

ruby on rails - Strong_parameters not working -

with ruby 1.9.3, rails 3.2.13, strong_parameters 0.2.1: i have followed every indication in tutorials , railscasts, can not strong_parameters working. should simple, can not see error. config/initializers/strong_parameters.rb: activerecord::base.send(:include, activemodel::forbiddenattributesprotection) config/application.rb config.active_record.whitelist_attributes = false app/models/product.rb class product < activerecord::base end app/controllers/products_controller.rb: class expedientescontroller < applicationcontroller ... def create @product = product.new(params[:product]) if @product.save redirect_to @product else render :new end end end this raises forbidden attributes exception, expected. when move to: ... def create @product = product.new(product_params) # , same flow before end private def product_params params.require(:product).permit(:name) end then, if go form , enter "name: pr

Why does GCC not complain about _Bool in c89 mode? -

why following command produce no warnings or errors, though _bool not part of c89? $ echo "_bool x;" | gcc -x c -c -std=c89 -pedantic -wall -wextra - for comparison, changing _bool bool results in error: $ echo "bool x;" | gcc -x c -c -std=c89 -pedantic -wall -wextra - <stdin>:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘x’ this happens on cygwin [gcc (gcc) 4.5.3] , linux [gcc (gcc) 4.1.2 20080704 (red hat 4.1.2-54)]. using _bool in c89 compiler invokes undefined behavior because use identifier starting underscore , upper case letter. don't have paper copy of c89 handy, expect same c99 7.1.3: — identifiers begin underscore , either uppercase letter or underscore reserved use. one permissible undefined behavior accepting _bool without diagnostic. gnu extension. of course, bool doesn't fall implementation namespace, must diagnosed unless declared.

Node.JS Spawn inside an SELinux Sandbox -

i building node.js application involves redirecting user input server-side command. of course, catastrophic security, desire run child command inside selinux sandbox . (i not want run entire application inside of sandbox because want end users each have own workspace on server.) for example, consider command cowsay . in order run sandboxed cowsay, need sandbox cowsay . other behind-the-scenes security differences, interface of sandbox cowsay should same of plain cowsay . however, node.js responds differently these 2 approaches. consider code: var spawn = require('child_process').spawn; var cmd = spawn("cowsay", ["hello"]); // line (no sandbox) var cmd = spawn("sandbox", ["cowsay", "hello"]); // line b (with sandbox) cmd.stdout.on("data", function(data){ console.log("stdout: "+data); }); cmd.stderr.on("data", function(data){ console.log("stderr: &qu

Mysql delete constraint -

i have table below structure : create table `lm_help` ( `id` int(10) not null auto_increment, `section` int(10) not null, `language` int(10) not null, `title` varchar(255) not null, `text` text not null, `timestamp` timestamp not null default current_timestamp, primary key (`id`), unique key `unique_help` (`section`,`language`), key `language_constraint` (`language`), constraint `language_constraint` foreign key (`language`) references `lm_languages` (`id`), constraint `section_constraint` foreign key (`section`) references `lm_help_sections` (`id`) ) engine=innodb auto_increment=4 default charset=latin1 i need remove "unique_help" key, getting foreign key constraint error. due error not able remove among these, section_constraint, language_constraint, unique_help. below other tables refer : create table `lm_languages` ( `id` int(11) not null auto_increment, `name` varchar(255) not null, `code` varchar(255) not null, `status` int(11) def

android - Why findViewById() throws Null Exception? -

why findviewbyid throws null exception?here layout , sourcecode file: <relativelayout ... tools:context=".mainactivity" > <textview android:id="@+id/usernametext" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </relativelayout> and here source code in mainactivity: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); try{ textview text=(textview)mainactivity.this.findviewbyid(r.id.usernametext); text.settext(10); }catch(exception e){ log.i("log", e.getmessage()+"error!"); // logcat message } } however, findviewbyid() returns null, , don't know why. code simple. text.settext(10); in way looking string id = 10; should change in text.settext(string.valueof(10));

list - How can I invoke *this* on a JRBeanCollectionDataSource? -

i passing list of images report. want render inside list object in report. i have used jasperreports lists before , i'm aware can reference each field of element in list using $f{} tag, how can reference element of list itself? basically use $f{this} , or $f{self} . there such thing? yes, can use alias _this . the quote jasperreports ultimate guide : special field mapping can used access current javabean object itself. thus, when field uses _this description or name, data source return current javabean object field value. useful when report needs extract current object data not correspond property follows javabeans standards (for instance, data returned method takes arguments), or when current object needs passed argument method called in 1 of report expressions. the sample of using _this the snippet of jrxml file: <subdataset name="dataset1"> <field name="city" class="java.lang.string"> <fieldd

Java: How to download a file via imap:// protocol? -

how can download file given following url java-se-7: imap://georg@imap.acme.com:143/fetch%3euid%3e/inbox%3e18678?filename=testmail.eml any highly appreciated - thank in advance. here's basic solution. following code needs apache commons i/o 2.4 can downloaded here : public class imapmessage { private string authority; private string protocol; private string host; private int port; private string username; private string password; private string foldername; private long msgid; private string filename; private message message; public imapmessage(string url) throws ioexception, messagingexception { parseurl(decodeurl(url)); } @override public string tostring() { return "protocol: "+protocol+"\n"+ "host: "+host+"\n"+ "port: "+port+"\n"+ "username: "+username+"\n"+

linux - find command in python failing with "missing argument to -exec" -

i trying find files older number of days , remove them subprocess.call(['find', directory, '-mtime', '+5', '-exec', 'rm', '{}', r'\ ']) why call giving me missing argument -exec error message while using exec , need semicolon indicate end of command. subprocess.call(['find', directory, '-mtime', '+5', '-exec', 'rm', '{}', ';'])

silverlight - Clientaccesspolicy.xml to be found under a port on Tomcat -

i running tomcat 6 server configured use port 7787.i have post data silverlight app servlet running on server.ofcourse crossdomain requires me have clientaccesspolicy.xml in root. i have seen various questions here , on web , have same answer.to put xml in webapps/root.this works if try access xml via http://somedomain/ however since servlet running on port 7787 have post somedomain:7787 , silverlight tries find xml under http://somedomain:7787/ this unsuccesfull. i sure silverlight indeed check somedomain:7787 xml used firebug confirm it.is there in tomcats configuration can change or somewhere else can place xml silverlight can find under port 7787.or there perhaps can change on silverlight side post being done? on windows machine copy 2 security files tomcat's webapps/root folder long can response ...:7787/crossdomain.xml, anyway solution ok. looks silverlight cares response. i created silverlight client , ok response both wcf service , tomcat.

r - Set a variable using colnames(), update data.table using := operator, variable is silently updated? -

this question has answer here: why data.table update names(dt) reference, if assign variable? 1 answer well one's bit strange... seems creating new column in data.table using := operator, assigned variable (created using colnames) changes silently. is expected behaviour? if not what's @ fault? # lets make simple data table require(data.table) dt <- data.table(fruit=c("apple","banana","cherry"),quantity=c(5,8,23)) dt fruit quantity 1: apple 5 2: banana 8 3: cherry 23 # , assign column names variable colsdt <- colnames(dt) str(colsdt) chr [1:2] "fruit" "quantity" # let's add column data table using := operator dt[,double_quantity:=quantity*2] dt fruit quantity double_quantity 1: apple 5 10 2: banana 8 16 3: cherry 23

c# - Random number generator only generating one random number -

i have following function: //function random number public static int randomnumber(int min, int max) { random random = new random(); return random.next(min, max); } how call it: byte[] mac = new byte[6]; (int x = 0; x < 6; ++x) mac[x] = (byte)(misc.randomnumber((int)0xffff, (int)0xffffff) % 256); if step loop debugger during runtime different values (which want). however, if put breakpoint 2 lines below code, members of "mac" array have equal value. why happen? every time new random() initialized using clock. means in tight loop same value lots of times. should keep single random instance , keep using next on same instance. //function random number private static readonly random random = new random(); private static readonly object synclock = new object(); public static int randomnumber(int min, int max) { lock(synclock) { // synchronize return random.next(min, max); } } edit (see comments): why need lock her

winapi - Is it possible to prevent an application from being activated (brought to front) without using DLL injection? -

i need write application a, intercepts wm_activate message window of application b in order prevent b becoming top-most application. is possible without dll injection (add hook on message, process , "neutralize" series of winapi calls) ? i think you're after: locksetforegroundwindow http://msdn.microsoft.com/en-us/library/windows/desktop/ms633532(v=vs.85).aspx remarks system automatically enables calls setforegroundwindow if user presses alt key or takes action causes system change foreground window (for example, clicking background window). function provided applications can prevent other applications making foreground change can interrupt interaction user. just don't forget unlock :) edit: try setwineventhook described here: is there windows system event on active window changed? then when unwanted window comes front can send background.

java - NullPointerException in booking app -

i'm getting nullpointerexception at: if(bookinglist.size() == 0) , bookinglist.add(vehiclebooking) and bookinglist.add(rvbooking) and not sure causing it. appreciated. stack trace bookingsystem.ferrybookingsystem @ localhost:59034 thread [main] (suspended (exception nullpointerexception)) ferrybookingsystem.bookingidexists(string) line: 35 ferrybookingsystem.addvehiclebooking() line: 49 ferrybookingsystem.main(string[]) line: 114 c:\program files\java\jre7\bin\javaw.exe (14/05/2013 10:52:02 pm) bookingexception package bookingsystem; import java.util.arraylist; import java.util.scanner; import java.io.*; class bookingexception extends exception{ string message; string ids; public bookingexception(string message){ this.message = message; } public bookingexception(string message, string ids){ this.message = message; this.ids = ids;

C# using SOAP with other transport layer than HTTP -

while soap standard transport layer agnostic, microsoft in infinite wisdom decided helper classes shouldn't be, @ least not in obvious, documented way. so there third party library or other mechanism (i'm thinking soap aware xml serializer perhaps) accepts parameter soap message (as string or stream) , returns meaningful data structure (like dictionary or dynamic), or have write myself?

Use/Purpose of beans in Spring -

could give overview or summary of purpose of beans in spring framework context? i understand standard java bean (no arg constructor, getters/setters, serialized), spring bean purpose seems different. is way of implementing singleton design pattern (one instance, factory classes) in simple, reusable fashion? i've used spring annotations , feel need grasp in order understand spring. thanks! i understand standard java bean (no arg constructor, getters/setters, serialized), spring bean purpose seems different. you mean always serialized. why think purpose seems different? in end, write classes. lot of time these pojos, plain old java objects. implement interface or extend class, classes. beans classes. don't overcomplicate it. now spring might take beans (classes) , manage them via of number of policies (prototype, singleton) doesn't change bean is, speaks how spring manages bean.

ios - Method is not calling from UITableview? -

i have uitableview , in didselect method i'm calling method of class parameter , when click row want open class xib corresponding paramter .but here when click uitableview row nothing happening ,actually method calling new xib not opening. following code in didselect method` - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{ searchresult* hit = (searchresult*)[results objectatindex:[indexpath row]]; [epubviewcontroller loadspine:hit.chapterindex atpageindex:hit.pageindex highlightsearchresult:hit]; } ` epubviewcontroller object of second class , "loadspine: atpageindex: highlightsearchresult:" method in class" please me you not presenting epubviewcontroller . add line after loadspine method call: [self.navigationcontroller pushviewcontroller: epubviewcontroller animated: yes]; also, pass hit epubviewcontroller , call loadspine on viewdidload or viewdidappear method inside of e

html - Moving the images to a different position -

i've been trying move small images (thumbnails) won't move. stays fixed left. i've tried giving div id , set margins doesn't work. here codes: javascript function showimage(imgname) { document.getelementbyid('largeimg').src = imgname; showlargeimagepanel(); unselectall(); } function showlargeimagepanel() { document.getelementbyid('largeimgpanel').style.visibility = 'visible'; } function unselectall() { if(document.selection) document.selection.empty(); if(window.getselection) window.getselection().removeallranges(); } function hideme(obj) { obj.style.visibility = 'hidden'; } css #largeimgpanel { text-align: center; visibility: hidden; position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(100,100,100, 0.5); } html body <body> <img src="images/small1.png" style="cursor:pointer" onclick="sho

c++ - go back to first instruction when there is an error -

i creating simple console application obtain user input integer. i want condition should integer , should not more 3 , not less 0. the code came far is: #include <iostream> #include <sstream> #include <string> using namespace std; int main() { int uinval; while (true) { string tempoval; cout << "please enter value between 0-3:\n>"; cin >> tempoval; stringstream ss(tempoval); if (ss >> uinval) { break; cout << "entered invalid value"; } while (true) { if (uinval < 0 || uinval > 3) break; cout << "value must between 0-3"; } cout << "you have entered:" << uinval; return 0; } this works when input non-integer value a,b,c,d. not work when input -1 or 4 value. i not sure, maybe confused myself w

node.js - Why use javascript callbacks when cleaner syntax is available? -

i'm trying learn use node. far, good. but, being pretty new javassript , don't point of using callbacks when cleaner , more readable (at least me) syntax available. here's example code make point clearer: with callback: exports.create = function(req, res){ new todo({ content : req.body.content, updated_at : date.now() }).save(function(err, todo, count){ res.redirect('/'); }); }; without callback: exports.create = function(req, res){ newtodo = new todo({ content : req.body.content, updated_at : date.now() }); newtodo.save(); res.redirect('/'); }; both of these codes save new todo , redirect. my preference goes second one, find easier read, maybe there's difference don't get. there difference? the short answer is: avoid locking user interface while operation takes time finishing executing. in second example, if save function makes ajax call, have make synchronous ajax call.

oracle - Comparing one table in 2 schemas to find missing columns -

i made researches; didn’t find similar question. if question duplicated please excuse me because didn’t find in researches. i have 2 schemas, schema1 , schema2, , both of them have same 6 tables. but not every table have same column in schema. exp: tab1 has 40 column exists in schema1 tab1 has 38 columns exists in schema 2. there 2 missing columns want add them. there data need insert. i can insert them manually take me time, isn’t there simple query? in researched found tools that. thanks the following show columns in schema1 don't exist in schema2. select table_name, column_name, data_type, data_length all_tab_columns owner = 'schema1' minus select table_name, column_name, data_type, data_length all_tab_columns owner = 'schema2' i edited above include alex's suggestions include data type , length in output.

Getting Device ID using JQuery or Javascript -

is there way device's unique id using jquery/javascript. i know 1 can detect user agent , type of device being used not required. need know unique id being used. having said know browser least priviliged application running on machine , should able id. but still asking if there way? not possible far know. i believe it's security issue. device id sensitive information wouldn't want website being able capture. update: it's not possible (without hackery @ least) physically distinguish computers accessing web site without permission of owners. can store cookie identify machine when visits site again key user in control, , rightly so.

html - Retrieving formatted text from MySQL database -

i send text html tags mysql database: <p>hello</p><br> <h3>header</h3> but when retrieve database jsp page looks like: &lt;p&gt;hello&lt;/p&gt;&lt;br&gt; &lt;h3&gt;header&lt;/h3&gt; how preserve rich text formatting when outputting?

android - Try to start library project Activity -

i have library project , main project , try start activity defined in library project main project. intent intent = new intent("isr.launch"); intent.setcomponent(new componentname("com.isr", "com.isr.activity.cameraactivity")); startactivity(intent); but receive following exception: 05-14 17:13:42.853: e/androidruntime(29217): java.lang.securityexception: permission denial: starting intent { act=isr.launch cmp=com.isr/.activity.cameraactivity } processrecord{40aa7178 29217:com.ssbs.sw.swe/10094} (pid=29217, uid=10094) requires null 05-14 17:13:42.853: e/androidruntime(29217): @ android.os.parcel.readexception(parcel.java:1322) 05-14 17:13:42.853: e/androidruntime(29217): @ android.os.parcel.readexception(parcel.java:1276) 05-14 17:13:42.853: e/androidruntime(29217): @ android.app.activitymanagerproxy.startactivity(activitymanagernative.java:1351) 05-14 17:13:42.853: e/androidruntime(29217): @ android.app.instrumentation.execstartac

Where are rails script-generated routes stored? -

using rails script, have generated 5 column table (id, title, content, created_at, updated_at) , relevant views , controllers using following command: rails generate scaffold input title:string content:text it created few new routes creation, reading, updating , deletion of database entries: inputs /inputs(.:format) inputs#index post /inputs(.:format) inputs#create new_input /inputs/new(.:format) inputs#new edit_input /inputs/:id/edit(.:format) inputs#edit input /inputs/:id(.:format) inputs#show put /inputs/:id(.:format) inputs#update delete /inputs/:id(.:format) inputs#destroy but these routes stored? they're not in rails' 'routes.rb' file! open config/routes.rb file. find entry resources :inputs . this responsible creation of these restful routes meaningful path helpers see above. a resource , default, adds

linux - Why Chef do not find my files? -

i'm developing ganglia recipe in chef . simple, build 4 different configurations files, tried use template , keep simple, build these configuration files. this recipe: return if tagged?('norun::ganglia') case node[:platform] when "ubuntu", "debian" pkg = "ganglia-monitor" when "redhat", "centos", "fedora" pkg = "ganglia-gmond" end package "#{pkg}" action :install end cookbook_file "/etc/ganglia/gmond.conf" owner "root" group "root" mode "0644" source "gmond/" + node['base']['dc'] + "/node/gmond.conf" end # adding ganglia-gmond service service "gmond" supports :status => true, :restart => true action [ :enable, :start ] end and how recipe structured: cookbooks/ganglia/ cookbooks/ganglia/files/default/gmond/* // have others sub-folders here co

java - SWT Splitpane thats scrollable -

i have been working jpanels , such build gui's. work use swt build gui's. have composite i've added sash splits sash vertically or horizontally based on attributes of template. question how in swt split sashform , make scrollable on either side of split. if split sashform vertically want ability scroll on either side of split individually. possible in swt? if example of how appreciated. below general idea of code im working with. because work related can not provide code reviewed. class method in extends composite. private void createcontent() { this.setlayoutdata(new griddata(swt.fill, swt.fill, true, true)); this.setlayout(stacklayout); (dvtemplate dvtemplate : loadabletemplates) { (compositetemplate template : dvtemplate.templatelist) { composite templatecomposite; composite parentcomposite = this; if (!isempty(template.parentcomposite)) { parentcomposite = compositemap

c# - MD5 Hash different on local machines -

i have md5 hash method so: md5 md5 = system.security.cryptography.md5.create(); stringbuilder sb = new stringbuilder(); lock (md5) { byte[] inputbytes = system.text.encoding.ascii.getbytes(input); byte[] hash = md5.computehash(inputbytes); (int = 0; < hash.length; i++) { sb.append(hash[i].tostring("x2").tostring(cultureinfo.invariantculture)); } } return sb.tostring(); on several local dev machines using same input, returns same hash. on staging , live servers too, returnging expected value. however, on few local development machines values differ. , cannot figure out why? i added lock , cultureinfo in response other answers on here.. alas. nothing. any , appreciated in matter! update: i have gotten point compared inputbytes array on 'good' vs. 'bad' machine , arrays identical. so what, if anything, computehash method do

ckeditor inline editing appending some classes a role and other stuff to my div -

how prevent or remove stuff ckeditor adding divs when doing inline editing. when load page div looked this: <div contenteditable="true"> after used ckeditor edit content in div , used ajax save content save edits div looked this: <div contenteditable="true" class="cke_editable cke_editable_inline cke_contents_ltr" tabindex="0" spellcheck="false" style="position: relative; " role="textbox" aria-label="rich text editor, editor1" title="rich text editor, editor1" aria-describedby="cke_56"> you can't this. these attributes internal , required ckeditor run, identify elements, provide accessibility , fix bugs. there until call editor.destroy() . additionally, approach must little bit wrong since have editor's container in output. correct way editor's data is: ckeditor.instances.yourinstancename.getdata(); this content filtered , fixed. if want

c# - Delete non-empty worksheets from excel workbook -

i want delete worksheets excel workbook. when program loaded, reads sheets in workbook, lists them in gridview user can select sheets should in output file. when user hits save button, delete worksheets based on selection , save workbook. works. except when there content in worksheet. delete empty worksheets, not worksheets content. foreach (var item in _view.sheets) { exc.worksheet ws = wb.worksheets[item.name]; if (!item.include) { ws.delete(); } } any clues? try turn off alerts: app.displayalerts = false; foreach (var item in _view.sheets) { exc.worksheet ws = wb.worksheets[item.name]; if (!item.include) { ws.delete(); } } app.displayalerts = true;

git - How do I allow merge commits without a "Bug nnn" reference past gitzilla's hooks -

i have bugzilla , gitzilla set defined on gitzilla home page ( http://www.theoldmonk.net/gitzilla/ ) default post-receive , update hooks. when push commits appropriate "bug nnn"-like regexes works fine. problem have mark of merge commits similar regex or rejected gitzilla hooks: remote: ====================================================================== remote: cannot accept commit. remote: remote: no bug ref found in commit: if updated merge commit contain reference bug in bugzilla push succeeds. unfortunately, though merge commits tagged bug reference, bug in bugzilla isn't updated commit. so, think there 2 options fixing problem. option i'd able change in hook don't need "bug nnn" reference on merge commits. if that's not do-able, second best option update bug in bugzilla named in merge commit. you add --no-merges option hook here: https://github.com/gera/gitzilla/blob/master/utils.py#l76 change this: ascommand = [

delphi - How to simplify setting a variable multiple times? -

i want program sql query filters dates, using contents of combobox, in latter want months in letters, have use numbers query, used code: procedure tadh_filter.radiobutton3click(sender: tobject); var param : integer; begin if combobox1.text = 'january' begin param := 1; end else if combobox1.text = 'february' begin param := 2; end else if combobox1.text = 'march' begin param := 3; end else if combobox1.text = 'april' begin param := 4; end else if combobox1.text = 'may' begin param := 5; end else if combobox1.text = 'june' begin param := 6; end else if combobox1.text = 'july' begin param := 7; end else if combobox1.text = 'august' begin param := 8; end else if combobox1.text = 'september' begin param := 9; end else if combobox1.text = 'october' begin param := 10; end else if combobox1.text = 'november' begin param := 11; end else if combobox1.text = 'december' b

Apache + Symfony2 + HTTPS + Node.js + Socket.io: socket.emit not firing -

i've been spending hours upon hours on problem, no avail. edit: solution found (see answer) project background i'm building project in symfony2 , requires module uploading large files. i've opted node.js , socket.io (i had learn scratch, might missing basic). i'm combining these html5 file , filereader api's send file in slices client server. preliminary tests showed approach working great standalone app, handled , served node.js , integration apache , symfony2 seems problematic. the application has unsecured , secured section. goal use apache on ports 80 , 443 serving bulk of app built in symfony2 , , node.js socket.io on port 8080 file uploads. client-side page connecting socket served apache , socket run via node.js . upload module has run on https, page resides in secured environment authenticated user. the problem events using socket.emit or socket.send don't seem work. client server, or server client, makes no difference. nothing

ios - Setting outlet/action for view controller -

i have uibutton in view controller not root view controller in app. cannot drag , create outlet or action in header file. can root view controller. is there simple reason this? when using storyboard, xcode creates .h , .m file first view controller (named viewcontroller.h , viewcontroller.m). for each additional view controller add via interface builder, should manually add additional custom class files in order customize view controller. once add view controller story board via interface builder, follow these instructions: from main xcode menu, select file, new, file, pick objective-c class , click next. name custom class, , pick proper type view controller you've added (i.e. select uitableviewcontroller table view controller). from within xcode's interface builder, select new view controller , identity inspector tab, set class new class created. you should able ctrl-click drag uibuttons or other ui elements onto new .h or .m file , implement custo

asp.net mvc - Accessing columns in cross reference table via LINQ with Entity Framework -

i have users table, roles table, , cross reference table users_roles has following columns: user_id role_id beamline_id facility_id laboratory_id the beamline_id, facility_id, laboratory_id filled in depending on role_id. if has role_id of 2 ("lab admin") have entry in laboratory_id. i trying figure out how laboratory_id specific row in table. example, know have user_id = 1. want laboratory_id user_id = 1 , role_id = 2 ("lab admin"). this simple when dealing sql new entity framework , trying entities , i'm having trouble. using mvc in controller have done this: user user = new user(); user.getuser(user.identity.name); var labid = user.users_roles.where(r => r.role_id == 2); that should me "row" of user when role = lab admin don't know how grab labortory_id column now. thought maybe be: var labid = user.users_roles.where(r => r.role_id == 2).select(l => l.laboratory_id); but not correct. appreciated. e

Google DevTools missing UI info -

Image
i trying snapshot of heap usage of javascript test using google devtools. used site: https://developers.google.com/chrome-developer-tools/docs/heap-profiling along windows 7 , google chrome. the problem need see memory metrics (bytes vs kilobytes) under retained , shallow size, isn't showing. tried online, , mess devtools myself, can't seem find way display this. google's own site goes right here: to here: without explaining how did it... see in second image, using macos. why? infer size metrics based on these 2 images, know . here see when go on devtools: thanks help. the screenshot 'retaining paths' quite old. fresh versions show retaining tree. i've created bug this. https://code.google.com/p/chromium/issues/detail?id=240872 the retaining tree nonempty if select particular object in upper window. if object retainer object b , second object retainer 100mb array c see 3 objects in list. the small object retained size = sizeof c +

c - Multiple TCP streams interfere with each other -

i have client connects nfs server , writes data. multiprocess application creates many tcp connections there processes. problem if try 1 process, socket blocks on write little (that poll() not pause). if increase number of processes 8 or more, find myself being blocked poll() on each socket 30% of time. isn't purpose of using multiple tcp streams having independent send/receive buffers , should not block this? why having multiple streams interfering each other? link far saturation (as tested iperf). my thoughts on nfs server create socket per tcp connection, , have own receive buffers. know i'm making separate tcp sockets each process, should have own send buffers. if i'm not saturating link, why sockets blocking? you're assuming network has infinite bandwidth, , server has infinite capacity service requests you're sending. doesn't, in either case. increasing number of tcp connections linearly doesn't increase performance linearly. the

windows - ssi an error occurred while processing this directive -

i following error in shtml files [an error occurred while processing directive] this error not happen when including file, happens when if expressions like: <!--#if expr="$query_string = open-updates" --> open<!--#endif --> i running dev environment on windows machine using xampp turns out had put following directive in httpd.conf ssilegacyexprparser on the shtml files using came legacy apache server (1.x)

Any way to simulate intra-statement comment in VB.net? -

i have list of guids need put array literal in vb. each of them corresponds entity i'd document in code. in c#, i'd this: var guids = new[] { guid.parse("70b11854-ac3e-4558-85d9-dc2451d7dce2"), // thing foo guid.parse("dec3cc2c-9d22-4d7f-8293-8e584795211c"), // thing bar }; i'd in vb: dim guids = { guid.parse("70b11854-ac3e-4558-85d9-dc2451d7dce2"), ' thing foo guid.parse("dec3cc2c-9d22-4d7f-8293-8e584795211c") ' thing bar } but comments in middle of (multi-line) statement not legal. there way achieve type of comment in vb? vb not support this. the best option split multiple statements. const guid1 = "70b11854-ac3e-4558-85d9-dc2451d7dce2" ' thing foo const guid2 = "dec3cc2c-9d22-4d7f-8293-8e584795211c" ' thing bar dim guids = { guid.parse(guid1), guid.parse(guid2) } this @ least provides comments inline without adding overhead.

integration testing - How to have buildbot running a server and retrieving output after tests -

i'd run integration tests against running server , retrieve server output check later. here cheap way local slave (otherwhise you'll need fileupload step) class stopserver(shellcommand): def _init_(self): shellcommand.__init__(self, command=['pkill', '-f', 'my-server-name'], workdir='build/python', description='stopping test server') def createsummary(self, log): buildername = self.getproperty("buildername") f = '/home/buildbot/slave/%s/build/python/nohup.out' % buildername output = open(f, "r").read() self.addcompletelog('server output', output) class startserver(shellcommand): def _init_(self): shellcommand.__init__(self, command=['./start-test-server.sh'], workdir='build/python', haltonfailure=true,

database - Entering 40000 rows in sql server through loop -

i have make database system purely on sql server. it's diagnostic lab. should contain @ least 40,000 distinct patient records. have table named "patient" contains auto-generated id, name, dob, age , phone number. our teacher provided dummy stored procedure contained 2 temporary tables has 200 names each , in end makes cartesian product supposed give 40,000 distinct rows. have used same dummy stored procedure , modified according our table. rows inserted 1260 every time. each time run query not give more 1260 records. have added part of temporary name tables , stored procedure. declare @tfirstnames table( firstname varchar(50) not null ) declare @tlastnames table ( lastname varchar(50) not null ) declare @tnames table ( id int identity not null, name varchar(50) not null) insert @tfirstnames (firstname) select 'julianne' union select 'sharyl' union select 'yoshie' union select 'germaine' union select 'ja' union sel

javascript - JQuery: Iterate through an array by using on('click') -

i trying jquery struggling bit around. what i'm trying go through array 1 click @ time each time click on "next" button new item presented. let's take @ following code: $(document).ready(function(){ var stuff =["house","garden","sea","cat"]; (var i=0; i<stuff.length;i++) { console.log(stuff[i]); } }); now how thinking creating while loop $("#next").on('click', function(){i++;}); but somehow doesn't work. able explain me how in relatively simple way? when run through loop for statement, , not in response event. instead, want step through array each click. so, need define counter outside click function , increment (or reset, if you've reached end of array) each click. here sample code: $(function () { // shortcut document ready var stuff = ['house', 'garden', 'sea', 'cat'], counter = 0; console

objective c - Assigning NSNumber to NSString -

nsstring *string = [nsnumber numberwithint:2]; int var = [string intvalue]; var 2. so, why? understand, it's smth dynamic typing, what's under hood? there no casting going on in code example: [string intvalue] regular objective c method provided nsnumber retrieve value stored inside integer. fact assigned object nsstring pointer not change anything: object inside remains nsnumber . not crash because objective c dynamically typed language. lets assign objects of wrong types, if try calling methods of nsstring on string object, going crash: nsstring *string = [nsnumber numberwithint:2]; int var = [string intvalue]; // ok bool istwo = [string isequaltostring:@"2"]; // crash

windows - Delphi 6 cursor not changing -

if have buttonclick event sets cursor := crhourglass, application.processmessages, use topendialog choose file, , cpu-intensive, cursor behaves differently depending on whether on existing control when open dialog closes. if cursor on control cursor remains hourglass; if it's outside application , moved area while intensive process still taking place, cursor remains arrow. 1 cannot click or it's confusing user arrow not able it. stepping through debugger shows cursor -11 everywhere should be. using screen.cursor instead of cursor has same effect. is there solution? procedure tmyform.loadbuttonclick(sender: tobject); begin cursor := crhourglass; application.processmessages; if opendialog.execute begin // intensive // cursor = crhourglass here displayed different end; cursor := crdefault; end; first, make sure set cursor while cpu-intensive operation active. don't change cursor while choosing file — never see other programs that, after all

karma runner - How to log/dump/outout dom html -

i've tried: console.log(element('.users').html()); but thing log: { name: 'element \'.users\' html', fulfilled: false } i assume using angular scenario runner. the element().html() dsl returns future (see wikipedia ). logging future contain element, @ point when calling console.log , future not resolved yet - there no value in there. try this: element('.users').query(function(elm, done) { console.log(elm.html()); done(); }); the whole scenario runner works queue. test code executed (synchronously) , each command (eg. element().html in case) adds action queue. then, these actions executed asynchronously - once first action finishes (by calling done() ), second action executed, etc... therefore individual actions can asynchronous, test code synchronous, more readable.

java - how to update seekbar using a edittext -

i read example of how show progres of seekbar edittext web page: simple seekbar in android now problem how change seekbar if introduce number inside edittext box? help if can acces web page post code: main: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <textview android:id="@+id/textview1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <edittext android:id="@+id/edittext1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_margintop="94dp" > <request

netbeans maven-assembly-plugin builds jar with dependencies but without project classes -

in netbeans 7.2.1 trying build executable jar dependencies using maven assembly plugin. worked in past when building jar contains dependencies except classes project itself. when running clean install assembly:single target directory contains 2 jars, icfstatuspage-1.0-snapshot-jar-with-dependencies.jar , icfstatuspage-1.0-snapshot.jar. 1 contains dependencies, other classes. the build of jar dependencies seems ok. (missing pom files manual installed artifacts). [assembly:single] missing pom cf:conn-fwk-int:jar:1.0 missing pom cf:conn-fwk:jar:1.0 building jar: /users/petervannes/netbeansprojects2/icfstatuspage/target/icfstatuspage-1.0-snapshot-jar-with-dependencies.jar ------------------------------------------------------------------------ build success ------------------------------------------------------------------------ plugin configuration snippet ; <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</grou