Posts

Showing posts from March, 2015

c# - NHibernate many-to-many, unable to delete a row -

i've got following entities: project, projectmapping , user, it's many manyhere mappings: public projectmembershipmapping() { property(pm => pm.isaccepted, prop => prop.notnullable(true)); property(pm => pm.permission, prop => prop.notnullable(true)); manytoone(pm => pm.member, mapping => { mapping.lazy(lazyrelation.nolazy); mapping.cascade(cascade.all); }); manytoone(pm => pm.project, mapping => { mapping.lazy(lazyrelation.nolazy); mapping.cascade(cascade.all); }); composedid(pm => { pm.manytoone(prop => prop.member); pm...

Checkbox unchecked when I scroll listview on Android -

i new android development. created listview textbox , checkbox . when check checkbox , scroll down check other items in list view, older ones unchecked. how avoid problem in listview ? please guide me code. here code: main.xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:id="@+id/textview01" android:layout_height="wrap_content" android:text="list of items" android:textstyle="normal|bold" android:gravity="center_vertical|center_horizontal" android:layout_width="fill_parent"/> <listview android:id="@+id/listview01" android:layout_height="250px...

javascript - Strange behaviour whith shadowing -

although shadowing should never used (or obfuscate) because it's confusing, wanted understand it. , got strange thing : alert(parseint('123'));//here, expected 123 it's 'overshadowed' function parseint(){return 'overshadowed';} alert(parseint('123'));//here it's 'overshadowed' why first alert output 'overshadowed' whereas function not modified yet? p.s : got inspired variable shadowing in javascript in javascript, declarations implicitly placed @ beginning of scope ( "hoisted" ), doesn't matter if parseint() definition @ second, last, or first line.

jquery - Hide div when sub-components "empty" (nothing to display) -

fairly novice when comes jquery, in advance bearing me :) for divs set widths , heights, i'm looking way hide (set display: none;) these containers when nothing displayed on browser. moreoften not, when have nested html complicates things bit, sub-components need checked emptiness/display:none;. the closest i've come far using .text() method, trimming whitespace, , checking length. however, .text() ignores styles , grabs hidden text , since doesn't return dom structure difficult filter over. here's fiddle i've been playing with: http://jsfiddle.net/jbbkq/5/ i'd div "hidden content" in caught first jquery function, since hidden content surrounded in has it's display set none. does make sense? selects div's looking iterate on them , filter child collection based on being visible or not. if no children visible hide element self. $("div").each(function(){ if(!this.children().find(":visible").length)...

jquery - Safari not sending Cross Sub-Domain Cookie -

we have website > main.example.com we have mobile site > mobile.example.com our cookie domain > .example.com our mobile website client-side (backbone) heavy app makes $.ajax our main website. now safari , chrome both not send cookie alongside ajax requests. can see cookie stored in storage using developer tools browsers fail recognize , doesn't include them in requests. any ideas? i had trouble few month developing site uses backbone.js , consumes restful api via cors. learned cors request not send cookies default, have tell javascript send in request well. all have pass xhrfields options $.ajax request xhrfields: {withcredentials: true}

Xcode application running on Iphone but crashing on Ipad -

Image
i made universal application contains nib files both ipad , iphone ui's. in view controllers initwithnibname method call uiuserinterfaceidiompad == ui_user_interface_idiom() detect whether controller running on iphone or ipad. i launch respective nib files. when run app on iphone, works fine, when run on ipad crashes exc_bad_access error. error occurs when use view controller launch view controller, launches 1 in navigation stack. error occurs click view belongs third controller of stack. i cannot distinguish difference between nib files cause crash. have been working tirelessly figure out why happening cannot fix error. have insight might going on? any advice on how approach fixing problem appreciated. the first thing should enable "all exceptions" break point. accurately tell line of code exc_bad_access happening. next, turn on zombies , see over-release happening. so, in xcode, while holding option key, click product | run.... in ensuing wind...

Jquery Treeview Expand and Collapse node on text click with persist cookie option -

i expand , collapse nodes when click +/- symbols , when click text (hyperlink) next each symbol. want collapse previous node , expand node clicked. using following method. $(document).ready(function(){ // first example $("#navigation").treeview({ persist: "cookie", //i want store state , come state when reload page. collapsed: true, //i want collapse nodes when load. unique:true //i want open 1 node @ time }); }); i have tried lot of options none of them worked. please me. my html is: <ul id="navigation" class="treeview"> <li> <div> <a href="#">marketing</a> </div> <ul> <li> <div> <a href="#">joysticks</a> </div> ...

ruby on rails - How to add an image to the redmine top menu? -

i want put image on top menu of redmine plugin index page. in init.rb menu :top_menu, :my_link, {:controller => 'my_controller', :action => 'my_action'}, :caption => "my title" link image fit in syntax? you'll have css. if create menu with: menu :top_menu, :my_link, {:controller => 'my_controller', :action => 'my_action'}, :caption => "my title" it created class 'my-link'. all have define on css: #top-menu a.my-link { padding-left: 20px; background-image: url(../images/my-link.png); }

jsp - Flex - ExternalInterface.available -

the definition externalinterface.available goes this: "the externalinterface.available property indicates whether current flash player in container offers external interface." what exact meaning of above definition? also, when value of externalinterface.available becomes false? in application, embed generated swf file in jsp, i'll have related javascript functions in it. i'll call functions mxml using externalinterface.call method. thanks. the container flash player browser. if browser provides javascript vm, let player communicate website , vice versa. but if you'd run swf in standalone player, there no external interface available , javascript calls wouldn't work.

Java:Download Restart -

i have java program download file through https connection.the program follows, public class download extends observable implements runnable { private static final int max_buffer_size = 1024; public static final int downloading = 0; public static final int paused = 1; public static final int complete = 2; public static final int cancelled = 3; public static final int error = 4; private url url; // download url private static float size; // size of download in bytes private int downloaded; // number of bytes downloaded private int status; // current status of download private string location; public download(url url,string location){ this.url = url; size=-1; downloaded=0; status=downloading; this.location=location; download(); } public string geturl(){ return url.tostring(); } public static float getsize(){ return size; } public ...

Sorting an array of JavaScript objects -

i read following objects using ajax , stored them in array: var homes = [ { "h_id": "3", "city": "dallas", "state": "tx", "zip": "75201", "price": "162500" }, { "h_id": "4", "city": "bevery hills", "state": "ca", "zip": "90210", "price": "319250" }, { "h_id": "5", "city": "new york", "state": "ny", "zip": "00010", "price": "962500" } ]; how create function sort objects price property in ascending or descending order using javascript? sort homes price in ascending order: homes.sort(function(a, b) { return parsefloat(a.price) - parse...

jfreechart - Android XYPlot set width of line, size of point and disable legend -

i'm trying change width of line in xyplot , size of point, suggestion? and question - how disable legend simplexyseries? set null cause error. you can alter line thickness using either setseriesstroke() or setbasestroke() in chosen renderer. assuming xylineandshaperenderer , can change rendered shape using approach shown here . addendum: how disable legend ? you can pass false legend parameter chosen chartfactory method or jfreechart constructor.

forms - show other field if other selected in menu with javascript -

i trying display field capture users input if select other in select menu. code below id otherjobtype not unhiding when select other in menu. can spot have gone wrong? in advance. <style type="text/css"> #otherjobtype { display:none; } </style> <script type="text/javascript"> function jobtype(value){ if (value == 'other') { document.getelementbyid('otherjobtype').style.display = 'block'; } else { document.getelementbyid('otherjobtype').style.display = 'none'; } } </script> <select id="jobtype" name="jobtype" onchange="jobtype(this.value);"> <option value="option 1" selected>option 1</option> <option value="other">other</option> </select> <input name="otherjobtype" id="otherjobtype" type="text" size="50" ...

java - An error occurs whenever I try to open a jsp page in Eclipse. -

whenever open jsp page in eclipse ide, following error: eclipse.buildid=unknown java.version=1.5.0_14 java.vendor=sun microsystems inc. bootloader constants: os=win32, arch=x86, ws=win32, nl=fr_fr framework arguments: -product org.eclipse.epp.package.jee.product command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product error wed jun 06 18:00:25 cest 2012 problems occurred when invoking code plug-in: "org.eclipse.jface". java.lang.illegalargumentexception: argument cannot null @ org.eclipse.swt.swt.error(swt.java:3865) @ org.eclipse.swt.swt.error(swt.java:3799) @ org.eclipse.swt.swt.error(swt.java:3770) @ org.eclipse.swt.graphics.imageloader.load(imageloader.java:128) @ org.eclipse.swt.graphics.imagedataloader.load(imagedataloader.java:22) @ org.eclipse.swt.graphics.imagedata.<init>(imagedata.java:331) @ org.eclipse.wst.xml.ui.internal.editor.cmimageutil.getimagedescriptor(cmimageutil.jav...

excel - Retrieving multiple rows from multiple sheets -

i know best way approach problem. want search multiple sheets of data based on customerid , retrieve data each sheet such customer address(es), customer order(s), customer personal information, etc. options off top of head is... filter pivot tables customer automatically sheets? vlookup data 1 sheet based on customer search term is there way use sql-type command query data sheets , display? i retrieve similar sql query without use of macros. don't see way retrieve data these different tables in automated fashion. vlookup falls apart moment multiple data sets same key (for example, 10 order rows 1 cust_id) unless make kind of complex formula of items , predict how many need. i've used 2 solutions kind of problem: 1: several pivot tables on same sheet, each linked respective tables. unfortunately, user has select same filter each 1 needed. still cleanest solution , recommend it. 2: make translation table (sheet) glues of other tables together. eac...

Java execution in background -

i have developed app executes sql jobs. when click on execute button application goes running state , halts untill query executed. i want app should not halt , user should able enter other query , query execution should run in background. my question how run execution of queries in background? means when execute button clicked ,the remaining execution should run behind screen. my app developed using struts1.3 framework.i have written main functionality in execute() of action class code snippet of execute() dao dao1=new dao(); system.out.println("here...1"); con1=dao1.dbconnection(jndiname); statement st = con1.createstatement(); //status_id=1; resultset rs = st.executequery(query); system.out.println("here...2"); string id = long.tostring(system.currenttimemillis()); //int req_id = system.curre...

Does User Privileges affects the execution time of my mysql query -

suppose have 2 users, , b mysql db customer. user having privileges on particular db , , user b having complex specific privileges grant select,insert -> on customer.table1 -> 'user b'@'server.domain' -> identified 'pwrd'; now if run query on customer db on table1 table, there difference in execution times of query when run separately each through user , user b ? and how privileges checked @ time of query execution or checked @ time of connection building , stored else? what know privileges stored in table named 'user (host,user,password)' . permissions checked login user @ compile time of sql statement before executing sql statement. the permissions checked resources e.g. table, views, stored procedure, functions used in particular sql statement. user's priviledges or user level not affect execution time. when user tries connect database, mysql checks that particular username/host/pass...

php - How to display content in a modal box with images in that box -

currently have detailed page listing containing links page.php contains page.php?id=1, page.php?id=2, page.php?id=3, page.php?id=4..etc . want provide preview button on over clicking button without navigating these pages, can show content in popup/modal box without moving these pages? stuck id concept how can achieve this. source/link appreciable. you perform ajax call jquery based on button clicked, load page inside dialog: $('.previewbutton').click(function(){ // determine page id load // based on button clicked var pageid = ...; // fetch page $.get('page.php', {page: pageid}, function(data) { // show page content inside dialog $('.mydialog').html(data); }); }); for dialog example use jquery ui's dialog: http://jqueryui.com/demos/dialog/ with plugin can call $(".mydialog").dialog() make <div class="mydialog"></div> show pretty dialog.

php - Is this hashing function overkill -

i began work on project , contains following function hash passwords : function hash_password($password) { $account_id = $this->account_id; /* * cook randomness */ $password = str_rot13($password); $random_chars = "1%#)(d%6^".md5($password)."&h1%#)(d%6^&hb(d{}*&$#@$@fefwb".md5($password)."``~~+_+_o(ed##fvdfgrg:b>"; $salt = $account_id; $salt = ((int)$salt * 123456789) * 1000; $salt_len = strlen($salt); for($i=0; $i <= $salt_len; $i++) { $salt .= $random_chars[$i]; } $salt = str_repeat($salt, 3); return hash('sha256', base64_encode($password.$salt.$password), false); } *$account_id unique each user account. my question : function more secure doing simple : $salt = sha1($account_id); $hash = hash('sha256', base64_encode($password.$salt), false); cheers! using account id salt not idea - if can steal hashed passwords,...

How to Open new static page useing button click in Bada -

i have put image in header button , click on button open new window. you should construct new window (exactly form) in code attack event listener header button, listener code block use application frame this: frame *pframe = application::getinstance()->getappframe()->getframe(); then use method make form active , visible: result r; r = pframe->addcontrol(*pform1); //pform1 constructed new form pframe->setcurrentform(*pform1); pform1->requestredraw();

sqlite + flex 4.6 + array doubts -

here flex newbie. i've tested 'answer 2' code connecting flex sqlite but modified it: throwed in button, purpose populate list data, after being clicked; result half-success, got "[object object]" in list instead of data; how overcome problem? flex 4.6, code follows: <?xml version="1.0" encoding="utf-8"?> <s:view xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" title=""> <fx:declarations> <!-- place non-visual elements (e.g., services, value objects) here --> </fx:declarations> <s:layout> <s:verticallayout paddingtop="10" paddingleft="10"/> </s:layout> <fx:script> <![cdata[ import flash.data.sqlconnection; import flash.data.sqlstatement; import flash.filesystem.file; import flash.filesystem.filemode; import mx.collections.arraycol...

javascript - Why does this code run slow in firefox? -

so wrote code simple game. code runs @ 60 fps in both chrome , safari firefox barely manages 30-40 fps. code looks simple enough me. causing delay? i checked in firebug , found out 1 function "follow" taking time. here code: function checkcollision (ball0, ball1) { var dx = ball1.x - ball0.x, dy = ball1.y - ball0.y, dist = math.sqrt(dx * dx + dy * dy); if (dist < ball0.rad + ball1.rad) { var angle = math.atan2(dy, dx), sin = math.sin(angle), cos = math.cos(angle); var pos0 = {x: 0, y: 0}, pos1 = rotate(dx, dy, sin, cos, true), vel0 = rotate(ball0.spdx, ball0.spdy, sin, cos, true), vel1 = rotate(ball1.spdx, ball1.spdy, sin, cos, true), vxtotal = vel0.x - vel1.x; vel0.x = ((ball0.mass - ball1.mass) * vel0.x + 2 * ball1.mass * vel1.x) / (ball0.mass + ball1.mass); vel1.x = vxtotal + vel0.x; var absv = math.abs(vel0.x) + math.abs(vel1.x...

php - wordpress wp_insert_user user not registered -

im using code insert new wordpress user im on wordpress multisite. require_once("../../../../wp-config.php"); require_once(abspath . 'wp-admin/includes/admin.php'); $user=array('user_pass'=>$password,'user_login'=>$username,'user_email'=>$email,'role'=>'subscriber); $status = wp_insert_user( $user); im getting no errors , getting new user id cant see new user on admin panel. when trying add new user same email sais user registered. what problem ?

c# - How to programmatically surf on a web page like a human from Windows application? -

i need surf on web page using c# window application (with browser tool on it), , collect information data mining project. need tool me invoke events click , refer objects jquery or css selectors syntax read them , save in database. i try watin testing own web application. you might want try selenium... we use automated regression testing http://seleniumhq.org/

python - Matplotlib: no effect of set_data in imshow for the plot -

i have strange error can't fix without help. after set image imshow in matplotlib stays same time if change method set_data . take on example: import numpy np matplotlib import pyplot plt def newevent(event): haha[1,1] += 1 img.set_data(haha) print img.get_array() # data change @ point plt.draw() haha = np.zeros((2,2)) img = plt.imshow(haha) print img.get_array() # [[0,0],[0,0]] plt.connect('button_press_event', newevent) plt.show() after plot it, method set_data doesn't change inside plot. can explain me why? edit just added few lines point out want do. want redraw data after press mouse button. don't want delete whole figure, because stupid if 1 thing changes. the problem because have not updated pixel scaling after first call. when instantiate imshow , sets vmin , vmax initial data, , never touches again. in code, sets both vmin , vmax 0, since data, haha = zeros((2,2)) , 0 everywhere. your new event sho...

How to place multiple imports in a single line in python -

my question how place multiple imports in single line. from sys import argv os.path import exists can modify above statements single statement 1 shown below: from sys,os.path import argv,exists can way..?please correct me if wrong. nope, can't. sorry! the python import statement supports one module import statements @ time. if could this, hypothetically speaking, following mean: from threading, multiprocessing import thread, condition, lock what module condition imported from? both modules define such class. python prefers explicit on implicit; select 1 source import @ time results in least surprise , greatest clarity happening.

Navigate Buttons in flash builder -

how make button link page when using adobe flash builder make ios app here have example in main view have 1 buton, when click send me autoview(this name want go) ' protected function manualview_clickhandler(event:mouseevent):void { // todo auto-generated method stub navigator.pushview(views.autoview); } ]]> </fx:script> <s:button id="butauto" left="272" top="9" width="187" height="73" label="automatic" click="manualview_clickhandler(event)" enabled="true" horizontalcenter="5" verticalcenter="-108"/> '

android: device not supported by app- why? -

Image
i developing camera app. 1 of users complaining device not supported. it's acer a200 : i don't see reason why android market / google play marks app not supported device. know might reason? here manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.ttttrash.myapp" android:versioncode="32" android:versionname="3.2" > <application android:icon="@drawable/icon" android:label="@string/app_name" android:hardwareaccelerated="true"> <activity android:name=".cameraactivity" android:configchanges="keyboard|orientation|keyboardhidden" android:label="@string/app_name" android:windowsoftinputmode="adjustpan" > <intent-filter> ...

jquery - How to set a smooth transition for nearly the same images? -

i have series of 3 images trow unordered list. images same , small piece of image changing. way 'movie' kinda effect. i use jquery cycle plugin . i run problem can't seem figure out how set transition smooth images blend another. 1 image fades out , other fades in... , results in flash between images... can share example of smooth blending of same images? update: i've modified transition barely noticably fading out should each slide fades in. may need change speed, delay, and/or timeout properties match exactly trying accomplish. http://jsfiddle.net/lucuma/tcrcj/12/ transition: $.fn.cycle.transitions.smooth = function($cont, $slides, opts) { $slides.not(':eq(' + opts.currslide + ')').css('opacity', .99); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonreset(curr, next, opts); opts.cssbefore.opacity = 0; }); opts.animin = { opacity: 1 }; opts.animout = { ...

ruby on rails - How to call javascript from controllers? -

i have problem: want call modal errors if there errors in registration or sign in form. so how call js controllers or how should ? here controller: def create @user = user.new(params[:user]) if @user.save # handle successful save. else render :js => ('#login').modal('show') end end something this, in right way. make sure creating , declaring modal correctly: html: <head> <link href="path/to/bootstrap.css" rel="stylesheet"> <script src="path/to/jquery.js"></script> <script src="path/to/bootstrap-modal.js"></script> </head> <div id="login" class="modal hide fade in" style="display: none;"> <div class="modal-header"> ... </div> <div class="modal-body"> ... </div> <div class="modal-footer...

html - Obtain id value from radio button using jQuery -

problem: to obtain id radio button using jquery on click or without. jquery should detect if value set , choose or choose upon click. html code (scenario 1 - no selection made): <th><input type="radio" name="itemquestion" id="1" value="11"></th> <th><input type="radio" name="itemquestion" id="2" value="12"></th> <th><input type="radio" name="itemquestion" id="3" value="13"></th> <th><input type="radio" name="itemquestion" id="4" value="14"></th> <th><input type="radio" name="itemquestion" id="5" value="15"></th> html code (scenario 2 - selection has been made): <th><input type="radio" name="itemquestion" id="1" value="11"></th> ...

sql server - SQL ROW_NUMBER and sorting issue -

Image
in sql 2005/2008 database have table batchmaster. columns: recordid bigint - autoincremental id, batchnumber bigint - unique non-clustered index, batchdate). have sproc returns paginated data table. sproc works fine of clients, @ 1 sql server instance have problem records order. in general, @ sproc do select * ( select row_number() on (order bm.batchdate desc, bm.batchnumber desc) row, * dbo.batchmaster bm (nolock) ) row between @startingrow , @endgingrow so, can notice script above want return records sorted batchdate , batchnumber. that's not gonna happen 1 of our client: records in wrong order. also, notice first column (row), not in ascending order. can explain why so? your code doesn't sort results, sets 'row' based on order of batchdate , batchnumber , appears doing correctly. need add order row statement.

non relational database - RavenDB: efficient enough? -

my boss asked me think migrating non-relational database ravendb. understand, have rewrite in c# stored procedures. please tell me if using ravendb idea, , efficient enough? thanks. your question ambiguous. comparing ravendb sql on matter of efficiency not relevant. efficiency ambiguous here. however..! a designed lucene index (basic/core mechanics of ravendb) perform better stored procedure (especially if infested logic). basically, potentially faster. also, extracting logic (if any) belongs. the c# api amazing...

asp.net - Update Panel & Event firing twice -

i have aspx page 3 dropdown boxes via infragistic controls. 1 of them inside updatepanel , 2 outside of updatepanel suppose control displayed in 3rd 1 via asynpostback event. both dropdown boxes outside of updatepanel call same function in code behind depending on object pass it, show in 3rd dropdown box. problem is, function appears getting triggered twice regardless of dropdown box select , each call passes control function , second 1 whats being displayed when click on first one. how stop that? i'm expecting function fire once depending on control select. tried have each dropdown box point own function , still both of them got triggered.... <td style="width:3px;"><asp:hiddenfield id="pnb_recno" runat="server" /></td> <td style="width:100px;">line of business:</td> <td colspan="2" width="150px"><!--onselectionchanged="pnb_product_list"--> <ig:webdropdown id...

rest - Using http request headers with Symfony routing to return different content (html / json) -

i'm working on rest api using fosrestbundle , i'd able use same url returning html , json depending on request accept header; i.e. if call url directly browser ( accept : text/html etc) html returned twig file, if making ajax request ( accept : application/json etc), json returned using fosrestbundle. currently can work throwing small if statement @ top of each function check request accept header, if it's asking html returns twig file, if it's asking json hits service. you should rather send "accept" header requests. read content negotiation (“accept” http header) based routing in symfony2.0 , format listener .

ios - How can I check the cyclomatic complexity of an Xcode project's source? -

i need analyse large xcode project cyclomatic complexity . has got easy way of checking cyclomatic complexity of code contained within xcode project? is there tool setup read xcode projects, perhaps? can't seem find one. after searching, found this python script project useful. it works xcode projects, because ignores headers , #imports/includes - main issue other static analysing tools working xcode - have configure find sdk etc. hope helps else looking cc tool was. cheers :)

php - Posting on a Group timeline where I am the admin -

i looking way post on group timeline admin. want post php , want post "group" , not personal user account. how can this? edit: cannot post "group" in group. isn't possibile inside facebook. that's possible on facebook pages. can create facebook page , follow instructions post "page". here instruction authenticating page short summary: authenticate user , request manage_pages permission get list of pages user manages (https://graph.facebook.com/me/accounts?access_token=user_access_token) the response array of pages , applications user manages [...] within each block page access token or application access token can used make requests graph api.

spring - Tomcat JDBC MySQL ClassNotFoundException -

i use springmvc , jpa (using hibernate) on tomcat 7 server (running locally on mac). i able set embedded h2 database. now switched mysql , getting following error java.lang.classnotfoundexception: "com.mysql.jdbc.driver" org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1711) org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1556) this suggests tomcat having trouble finding mysql-connector java. there multitude of tutorials on how add connector $catalina_home/lib. after trying use maven dependency project, followed advice , copied .jar file lib directory: $ ls $catalina_home/lib/mysql*.jar /users/david/applications/tomcat/lib/mysql-connector-java-5.1.20-bin.jar i have read , execute permissions on directory , file. at moment can't figure out how make tomcat aware of jar. folder included in $catalina_home/conf/catalina.properties and have restarted server multiple times. thanks help. ...

asp.net mvc - How to pass List from Controller to View in MVC 3. -

i have list<> binded data in controller action , want pass list<> view bind datagrid in razor view. i new mvc.can 1 me how pass , how access in view. thanks in advance, balu passing data view simple passing object method. take @ controller.view method protected internal viewresult view( object model ) something this //controller list<myobject> list = new list<myobject>(); return view(list); //view @model list<myobject> // , property model type of list<myobject> @foreach(var item in model) { <span>@item.name</span> }

java - Can Intellij IDEA exist in a Netbeans Shop? -

all other colleagues use netbeans, have opportunity use idea. able work on same java ee projects together, or have issues projects, checking in , out of svn, etc? we develop ee , spring mvc applications using glassfish on our desktops, , commit svn, although possible may have load coworker's entire projec. you have issues sharing projects, because project folder , structure netbeans , idea different. however, can attempt share src folders 1 , update codes 1 through svn, though wouldn't advise compatibility reasons because won't able share libraries , use other team functionality available in netbeans. so won't idea use different ide don't waste time debugging compatibility. also, useful note idea uses own custom libraries functionalities, , build projects in different way netbeans, projects appear work on idea may not work on netbeans , vice versa. bottom line, don't waste time using different ide rest.

sitecore6 - Applying a Sitecore workflow for a particular user -

is possible apply workflow in sitecore particular user? i want apply workflow when editor edits item, don't want apply workflow on item in case admin edits it. possible? first question: workflow applied item. workflow, however, have security around it. means can have different actions/flows @ user (or role) level. second question: users have "user administrator" checkbox checked on "edit user screen" in fact bypass workflow.

Rotate axis text in python matplotlib -

i can't figure out how rotate text on x axis. time stamp, number of samples increase, closer , closer until overlap. i'd rotate text 90 degrees samples closer together, aren't overlapping. below have, works fine exception can't figure out how rotate x axis text. import sys import matplotlib matplotlib.use('agg') import matplotlib.pyplot plt import datetime font = {'family' : 'normal', 'weight' : 'bold', 'size' : 8} matplotlib.rc('font', **font) values = open('stats.csv', 'r').readlines() time = [datetime.datetime.fromtimestamp(float(i.split(',')[0].strip())) in values[1:]] delay = [float(i.split(',')[1].strip()) in values[1:]] plt.plot(time, delay) plt.grid(b='on') plt.savefig('test.png') easy way as described here , there existing method in matplotlib.pyplot figure class automatically rotates dates appropriately figure....

linux - Does the GCC compiler support classic C++? -

this question related process of porting on hp-ux executable. on hp-ux, executable compiled , linked using hp-ux acc compiler. given compiler way in 1996, doesn't appear supports standard c++ (the standard c++ used today). rather, compiles based on standard c++ hp-ux calls classic c++. wondering if gcc supported option classic c++? thanks. haven't found in gcc docs, might mistaken. you can port classic standard c++, using following 2 guidelines (from hp documentation ): (1.) iostream headers: <iostream.h> maps <iostream> <fstream.h> maps <fstream> , optionally <iostream> <strstream.h> maps <strstream> <iomanip.h> maps <iomanip> note new header file <iosfwd> can used if declaration of ostream , istream needed , not specific insertion , extraction operators. replace cases following used: class ostream; // replace #include <iosfwd> ostream& operator<<(ostream&, ...

tfs2010 - Add parameter to report URL: Parameter is missing a value -

Image
i'm trying insert ssrs report in webpart in sharepoint. report tfs sprint burndown chart. this, need generate report using following url: http://vhacpadev04/reportserver/pages/reportviewer.aspx?/tfsreports/vapars+team/sprint+burndown&rs:command=render&rs:format=html4.0&rc:parameters=true&rp:sprintparam=release+2%5csprint+1 the project name in tfs vapars team . sprint i'm trying run chart release 2 sprint 1 . typically, reportviewer prompt me parameter. in case, sprintparam: however, when hide (using &rc:parameters=false), following error: and here's parameter properties report on ssrs: i'm not sure how format url pass correct sprint parameter. suggestions? you need provide default value sprintparam (even though overriding in url) or need remove dependency on parameter if used cascading parameters. report thinks cannot run without information, though supplying in url. startdateparam , enddateparam query based i...

javascript - How to draw a touch straight line in HTML5 canvas -

i'm trying create drawing tool set ipad , far i've done square, i'm not sure how go coding straight line ? here's code finished square, maybe it'll help. know how code straight line. after that, if wanted draw circles well? in code need change? here's code: javascript (square/rectangle) // "draw rectangle" button function rect(){ var canvas = document.getelementbyid('canvassignature'), ctx = canvas.getcontext('2d'), rect = {}, drag = false; function init() { canvas.addeventlistener("touchstart", touchhandler, false); canvas.addeventlistener("touchmove", touchhandler, false); canvas.addeventlistener("touchend", touchhandler, false); } function touchhandler(event) { if (event.targettouches.length == 1) { //one finger touche var touch = event.targettouches[0]; if (event.type == "touchstart") { rect.startx = touch.pagex; rect.starty = touch.pagey; drag =...

mysql - GROUP BY each 6 months in one record -

i having trouble retrieving data db through select query such: select table.something table table.date between 'from' , 'to' group (each 6 months between , date). any idea how can done without having recur view , external grouping through code. something work: select table.something, ceil(month(date)/6) monthvalue table table.date between 'from' , 'to' group monthvalue

visual studio - PostBuildEvent in WindowsInstaller project returns error code '1' -

i have windows installer (vs 2008) project , want create simple post build event, opens target folder, installer selected. so i've typed following in postbuildevent field: explorer.exe /select, $(builtouputpath) the problem following error: error: error de 'postbuildevent' con el código de error '1' 'error no especificado' which translates like: error: 'postbuildevent' error error code '1' 'unspecified error' the thing is, folder opens, installer selected , all, keeps giving me error. so, doing wrong? it works fine "start": start explorer.exe /select, $(builtouputpath)

mocking - How to assert no other methods are invoked on a Unitils Mock -

i aware of mockunitils.assertnomoreinvocations(); , how achieve similar effect 1 mock object? i doing kind-of black box testing on methods. know list of methods may call on mocks, have make sure absolutely won't call other methods. it seems i'll need assertoptionallyinvoked() or assertnootherinovations() on mocks. possible unitils? solved implementing own scenario class.

javascript - self.el vs this.el -

i'm following backbone.js tutorial , came across 2 functions initialize() , render() . initialize() used $(self.el).append() when appending html while render() used $(this.el).append() . confused difference, appreciate explaination, thanks! js code // views window.winelistview = backbone.view.extend({ tagname:'ul', initialize:function () { this.model.bind("reset", this.render, this); var self = this; this.model.bind("add", function (wine) { $(self.el).append(new winelistitemview({model:wine}).render().el); }); }, render:function (eventname) { _.each(this.model.models, function (wine) { $(this.el).append(new winelistitemview({model:wine}).render().el); }, this); return this; } }); the first uses self keep reference this when scope changes when event fires. inside anonymous function (for event handler), this refer element fired ev...