Posts

Showing posts from April, 2012

javascript - Jquery Dialog Box - to open when clicked a hyperlink -

i have jquery datatable 1 column's each cell has hyperlink <a href = "...../path/?id=1234" > 1234 </a> <a href = "...../path/?id=1235" > 1235 </a> <a href = "...../path/?id=1236" > 1236 </a> they cells of column in jquery datatable. now, want open link in jquery dialog plus i new javascript please tell me if have <a href = "...../path/?id=1234" > 1234 </a> id =1234 value in href tag stored in variable have further run django queries using " id " value just add class links, , handle click event. instance: <a href = "...../path/?id=1234" class="dialog-link"> 1234 </a> <a href = "...../path/?id=1235" class="dialog-link"> 1235 </a> <a href = "...../path/?id=1236" class="dialog-link"> 1236 </a> this jquery code (make sure it's after 'document(ready)`.) $

php - ID is not showing in Edit Form Action -

i not able see id value in action of controller in edit form. showing somthing this.. <form action="/xxproj/userpages/edit" class="form-horizontal" id="userpageeditform" enctype="multipart/form-data" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="post"/></div> and here controller function.. <?php error_reporting(0); class userpagescontroller extends appcontroller { public $helpers = array("html", "form","session"); public $uses = array('userpage','usergroup'); public function index() { } public function edit($id = null) { $this->userpage->id = $id; $this->set("userpages", $this->userpage->read()); pr($this->userpage->read()); if ($this->request->is("get")) {

xslt - I need to remove dupilciate element that matches exactly -

i have input xml follows. target remove duplicate elements matches 1 another. input xml <namespaces> <namespace prefix="dc">http://purl.org/dc/elements/1.1/</namespace> <namespace prefix="gz">http://www.tso.co.uk/assets/namespace/gazette</namespace> <namespace prefix="xsl">http://www.w3.org/1999/xsl/transform</namespace> <namespace prefix="atom">http://www.w3.org/2005/atom</namespace> <namespace prefix="xd">http://www.oxygenxml.com/ns/doc/xsl</namespace> <namespace prefix="xs">http://www.w3.org/2001/xmlschema</namespace> <namespace prefix="xhtml">http://www.w3.org/1999/xhtml</namespace> <namespace prefix="atom">http://www.w3.org/2005/atom</namespace> <namespace prefix="xd">http://www.oxygenxml.com/ns/doc/xsl</namespace> <namespace prefix="xs">http://www.w3.org/

sql - Search sorting inSQL -

i have 4 columns (lastname, firstname, title, city) in table (mssql2008). want display search results in way if search word matches in full should come first other results column. example if have following table lastname firstname title city kirk yang sales rep seattle fuller andrew vice pred tacoma leverling janet sales rep kirkland peacock margaret sales rep redmond jacob kirk sales mag london suyama michael sales rep london king robert sales rep london callahan laura sales cord seattle david kirkpatrk sales rep london and if search kirk result should be: lastname firstname title city kirk yang sales rep seattle jacob kirk sales mag london leverling janet sales rep kirkland david kirkpatrk sales rep london edit: using union select results (naive, guess), tired case unable de

c# - Transfer the Winform Textbox data to Html Textbox -

i trying implent send data windows form text box control html text box, scenario: windows form in c# having various textbox control , 1 submit button while click on botton textbox data transfer html tetxtboxes. (i dont want use query string etc) my html code <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test application</title> <script type="text/javascript" language="javascript"> window.onload = body_onload; function body_onload() { document.getelementbyid("txtfirstname").focus(); } </script> </head> <body> first name: <input type="text" id="txtfirstname" /><br /> last name: <input type="text" id="txtlastname" />

Facebook like button not displaying og:description -

i have created button on website, http://www.divecerts.com . screen shots of problem found @ http://www.divecerts.com/screen.html the top screenshot shows button being pressed fb popup , correctly scraped information. bottom screenshot shows actual post looks on facebook. there can see correct except descrition blank. i have cleared cache @ using facebook debug tool (linter) few times no luck on solving problem. debugger shows description fine not show on facebook post. have tried viewing/liking different facebook accounts on different computers using different browsers same results. here meta code <head> <meta property="og:title" content="divecerts.com | diver certification record search" /> <meta property="og:description" content="search scuba diving certifications records major training agencies in 1 click."/> <meta property="og:url" content="http://www.divecerts.com" />

Android - Trouble importing SlidingMenu library - SHA-1 Mismatch -

okay i'm close throwing computer out of window. head boiling rage lol im trying import slidingmenu lib brand new project. error: sha-1 mismatch. after lot of digging, found need have 1 android-support-v4.jar file in libs folder. that's fine except... which android-support-v4.jar suppose delete? 1 in project or 1 inside slidingmenu library? and where suppose add external jar ? project or slidingmenu library? thanks you can add both have match in terms of version. pick updated version , replace in respective lib folder. both android-support-v4.jar have same version, otherwise have conflict.

android - arrayadapter.clear() deletes underlying data -

i got following problem. got listview , 2 buttons. @ start of fragment data stored in 2 arraylists. @ first content of first arraylist shown in listview works fine. when use clicks first button listview shows second arraylist. works fine user call adapter.clear(). first arraylist got deleted. therefor cant switch first list clicking on first button. never delete arraylist wonder why adapter.clear() it. nice. code underneath. public class messagesfragment extends fragment { private arraylist<message> outbound; private arraylist<message> inbound; private messageadapter messageadapter; private int box; private view rootview; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_messages, container, false); outbound = new arraylist<message>(); inbound = new arraylist<message>(); this.rootview = rootview; box = 0;

mysql - FInd relationships within three products -

i using php , mysql if have following tables items ---- |order_id|sku| |------------| | 1 | | | 1 | b | | 1 | c | | 1 | d | | 1 | e | | 2 | b | | 2 | c | | 2 | d | | 3 | d | | 3 | e | | 3 | f | | 4 | | | 4 | b | | 4 | c | | 4 | f | -------------- i retrieve following info: | original_sku | bought_with_a | bought_with_a | times_bought_together | |--------------|---------------|---------------|-----------------------| | | b | c | 2 | | b | | c | 2 | | b | c | d | 2 | | c | b | d | 2 | etc etc i trying count number of times 3 products bought together. extension question: finding products customers bought together you should follow same approach in solution 3-way combi

loops - Summing specific data from column in r -

im trying creat function in r let me sum data last 3 rows new column (i.e. if im looking @ day 4 = days 3+2+1) this i've worked out far, doesnt work. s3<- function(x){ res <- numeric(nrow(x)) (i in 1:nrow(x)){ res[i] <- if (i > 3) { res[i] <- x[i-3,10] } else { res[i] <- x[i,10] } } x$pp3 <- res return(x) } use this: x$pp3 <- x[,10] + c(0,head(x[,10],-1)) + c(0,0,head(x[,10],-2)) if want function: s3 <- function(x, j=10){ within(x, pp3 <- x[,j] + c(0,head(x[,j],-1)) + c(0,0,head(x[,j],-2))) }

ruby on rails - Redirect to Page after Facebook Sign Up -

i'm trying redirect user after successful facebook sign (not sign in). i want redirect /getstarted/welcome after user registers for first time . my omniauth callback : def facebook # need implement method below in model (e.g. app/models/user.rb) @user ||= user.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? # throw if @user not activated sign_in_and_redirect @user, event: :authentication if is_navigational_format? set_flash_message(:notice, :success, kind: "facebook") end else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end for devise use def after_sign_up_path_for(source) '/getstarted/welcome' end my user model: facebook settings def self.find_for_facebook_oauth(auth,

extjs - create array of objects (multiple keys and values) -

i created var object put in key , values. i can call key , object[key] there keys repeated such as key = a, key = b, key = a, key = b i want separate first 2 objects in array[0][0] , array[0][1] , other 2 in array[1][0] , array[1][1]. possible? thanks in advance! deending on needs, can make array of arrays such. var arr = new array(); arr.push([{key:"a"}, {key:"b"}]); arr.push([{key:"a"}, {key:"b"}]); console logs => arr[0][0] object {key: "a"} arr[0][1] object {key: "b"} arr[1][0] object {key: "a"} arr[1][1] object {key: "b"}

c# - How to make a Clustered Service send traffic on the Virtual IP -

i have windows service written in c# communicates ftp server. have added service "generic service" on failover cluster running on windows 2008 r2. "generic service" has own virtual ip address. when ftp connection initiated, source ip address of node hosting service , not virtual ip. been suggested if service "cluster aware", source ip virtualip. we trying avoid adding ip address of every node in cluster acl of ftp server. looking programmatic solution cause service use virtual ip outbound traffic in clustered environment.

sql - SQLite: Self Join with WHERE Clause -

i have table used store hierarchy, references itself. in need of sql statement determine parent's node type. below have given structure of table sample data provide best explanation of trying figure out. nodes table create table if not exists nodes(id integer primary key autoincrement, type text not null, parent_id integer references nodes(id) on delete cascade note: parent_id can null reference root node. sample data insert nodes(type, parent_id) values('grp', null); -- id: 1, title: hello, world! insert nodes(type, parent_id) values('txt', 1); -- id: 2, title: print insert nodes(type, parent_id) values('rnd', 1); -- id: 3, title: random output insert nodes(type, parent_id) values('txt', 3); -- id: 4, title: output #1 insert nodes(type, parent_id) values('txt', 3); -- id: 5, title: output #2 insert nodes(type, parent_id) values('txt', 3); -- id: 6, title: output #3 there titles each node, have listed i

android - Code gets stuck at acquiring wake lock while registering with GCM -

i using gcm push notifications project, stuck @ acquiring wake lock. log message: 09-03 17:04:05.003: v/gcmbroadcastreceiver(5772): onreceive:com.google.android.c2dm.intent.registration 09-03 17:04:05.003: v/gcmbroadcastreceiver(5772): gcm intentservice class: example.pro.gcmintentservice 09-03 17:04:05.049: v/gcmbaseintentservice(5772): acquiring wakelock below manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="example.pro" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="16" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="and

python - Invalid syntax with conditional expressions -

it's started installing new python version, 2.7.5. error when wsgi runs django's wsgi.py file: [tue sep 03 23:25:42 2013] [error] [client xxx.xxx.xxx.xxx] mod_wsgi (pid=4710): target wsgi script '/var/www/empirik/data/www/mysite.com/my_project/wsgi.py' cannot loaded python module. [tue sep 03 23:25:42 2013] [error] [client xxx.xxx.xxx.xxx] mod_wsgi (pid=4710): exception occurred processing wsgi script '/var/www/empirik/data/www/mysite.com/my_project/wsgi.py'. [tue sep 03 23:25:42 2013] [error] traceback (most recent call last): [tue sep 03 23:25:42 2013] [error] file "/var/www/empirik/data/www/mysite.com/my_project/wsgi.py", line 22, in ? [tue sep 03 23:25:42 2013] [error] import os [tue sep 03 23:25:42 2013] [error] file "/home/envs/my_project/lib/python2.7/os.py", line 49, in ? [tue sep 03 23:25:42 2013] [error] import posixpath path [tue sep 03 23:25:42 2013] [error] file "/home/envs/my_project/lib/python2.7/posixp

iphone - Returning a bool value using dispatch_async -

simple question time, i've made "utility" class in new app me call method in different uiviewcontroller. i use class function that. i'm facing new problem, have check if icloud available or not , use : + (bool)isicloudavailable { bool isbothicloudenabled = no; bool isicloudavailable = no; nsurl *ubiq = [[nsfilemanager defaultmanager] urlforubiquitycontaineridentifier:nil]; if (ubiq) { isicloudavailable = yes; } else { isicloudavailable = no; } nsuserdefaults *ausericloud = [nsuserdefaults standarduserdefaults]; bool boolpref = [ausericloud boolforkey:@"icloudenabled"]; if (boolpref && isicloudavailable) { isbothicloudenabled = yes; } else { isbothicloudenabled = no; } return isbothicloudenabled; } and on uiviewcontroller use : if ([utils isicloudavailable]) {... } urlforubiquitycontaineridentifier:nil must called on main

python - pandas - plotting integration with matplotlib -

given data frame: xlabel = list('xxxxxxyyyyyyzzzzzz') fill= list('abc'*6) val = np.random.rand(18) df = pd.dataframe({ 'xlabel':xlabel, 'fill':fill, 'val':val}) this i'm aiming at: http://matplotlib.org/mpl_examples/pylab_examples/barchart_demo.png applied example, group x , y , z , gender a , b , c , , scores val . i'm aware in pandas plotting integration matplotlib still work in progress, possible directly in matplotlib? is want? df.groupby(['fill', 'xlabel']).mean().unstack().plot(kind='bar') or df.pivot_table(rows='fill', cols='xlabel', values='val').plot(kind='bar') you can brake apart , fiddle labels , columns , title, think gives plot wanted. for error bars you'll have go mpl directly. mean_df = df.pivot_table(rows='fill', cols='xlabel', values='val', aggfunc='mean') err_df = df.

python - updating wx.Gauge and keep current frame alive? -

i'm writing little tool downloads file website using python , wxpython. i've got working, thing's been bugging me want use progress bar show completion, , after urlretrieve, thing's moving progressbar, gui become unresponsive. know that's threading i'm new @ this. can give me hint? the idea @ main frame search result site, , give result downloadlistingframe, generates buttons , statictext on fly. problem after click download button, progressbar updates file's being download, other whole app hangs. after reading else's code other example, thought put dodownload function in thread , executed it, acts same not using threading... thanks in advanced. class downloadlistingframe ( wx.frame ): data = '' def __init__( self, parent, result ): wx.frame.__init__ ( self, parent, id = wx.id_any, title = u'result', pos = wx.defaultposition, size = wx.size( 500,300 ), style = wx.default_frame_style|wx.tab_traversal ) self.setsizehin

c# - Scheduled events on server -

i'm creating web app using asp.net tracks number of tasks have due date stored in sql database. my goal have server notify user when due date has passed, whether it's via email, on browser interface, or via other means of communication. there potentially thousands of tasks can due @ time, think polling inefficient. what "correct" or "best" way achieve using c#? general explanation of process great. i think 1 of best ways using asynchronous programming async , await explained in msdn .

windows 8 - CameraCaptureUI.captureFileAsync fails to return IAsyncOperation object -

for reason, code unable retrieve iasyncoperation object returned upon calling capturefileasync method of windows.media.capture.cameracaptureui() method. iasyncoperation object returned according this documentation . in documentation link, states: return value type: iasyncoperation<storagefile> when operationcompletes, storagefile object returned. so here code: var dialog = new windows.media.capture.cameracaptureui(); var aspectratio = { width: 4, height: 3 }; dialog.photosettings.croppedaspectratio = aspectratio; appsession.inasyncmode = dialog.capturefileasync(windows.media.capture.cameracaptureuimode.photo).done(function (file) { if (file) { self.addpage(url.createobjecturl(file)); } else { winjs.log && winjs.log("no photo captured.", "sample", "status"); } }, function (err) { // none taken }); when inspect value of appsession.inaysncmode, see function return

ember.js - Emberjs linkTo doesnot update collection i.e department.find() -

learning emberjs not sure if stackoverflow question or git issue. decided put on stackoverflow first. here jsbin (open in firefox ..not in chrome raw.github file used) when click on "<- department" in department template reached after creating new department navigate departments template #each not display newly added department name in list. it show newly added department on refreshing browser on /departments update it seems .set() method working reason new object created returning name , id undefined. might bug ember-model perhaps. the best solution moment have 2 save methods, 1 on edit controller , adding different save method creating new department. app.newcontroller = ember.objectcontroller.extend({ save:function(){ var newdep = app.department.create({name: this.get('name')}); newdep.save(); this.get('target').transitionto('department', this.get('model')); } }); here jsbin new control

c++ - Strange syntax flaw in mingw -

at line 23- cout<"" doesnt give error instead removing statement produces abnormal output. have tried in codeblocks using mingw32. when remove gives- process returned 1984687287 (0x764df487) #include<iostream> #include<stdio.h> using namespace std; int ispalin(long num) { long sum=0,n; short rem; n=num; while(n>0) { rem=n%10; sum=sum*10+rem; n/=10; } if(sum==num)return 1; return 0; } int main() { int n=1; for(int i=999;i>=1;i--) { for(int j=999;j>=1;j--) { if((i*j)<=n) { cout<""; // line 23 break; } if((i*i)<=n) { printf("%d",n); return 0; } if(ispalin(i*j)) { n=i*j; cout<<n<<"\n"; break; }

Azure FTP Issue - cannot upload files -

i cannot connect azure ftp account. see folder try upload files to, site folder using filezilla do, see of files fail upload. else has similar issues? ftp on azure works "passive mode". check out link http://blogs.msdn.com/b/wats/archive/2013/12/13/setting-up-a-passive-ftp-server-in-windows-azure-vm.aspx , follow every step set passive mode. you need tell ftp client keep connection alive doesn't start second connection while first connection still alive. set in filezilla client, go edit, settings, connection, ftp, , check "send ftp keep-alive commands" checkbox. hope helps!

css3 - jQuery .outerHeight returning correct for parent and 0 for child -

i have function determines starting coordinates block of text. used create page can not scroll vertically, horizontally. creates columns of text, starting up/down, , when doesn't fit sends next column. in case blocks of text orders, must kept (i.e. if order doesn't fit in column, send next column, don't split it). the issue i'm having determining whether block of text fits vertically on page (in it's own column, i.e. page height > block height) default width or if needs made wider accommodate data. element tested on passed in object, , when thiselement.outerheight(true), returns correct result. when thiselement.find('.orderheader').outerheight(true) 0. why this? i have included function provide context. thank much. function determinestartcoordinates(lastelement,thiselement) { var thiselementheight= thiselement.outerheight(true); var lastelementposition= lastelement.position(); var lastelementtop= lastelementposition.top;

oop - Limit access to a Class library in C#.NET -

i have c# class library going used in 2 different projects. 1 of them should access public classes , methods , other 1 should access of classes , methods . what best solution ? i think best bet internalsvisibleto attribute ordinarily, types , members internal scope (in c#) , friend scope (in visual basic) visible in assembly in defined. internalsvisibletoattribute attribute makes them visible types in specified assembly, known friend assembly. attribute applied @ assembly level. means can included @ beginning of source code file, or can included in assemblyinfo file in visual studio project of course doesn't prevent people calling methods using reflection

javascript - Color Thief won’t work … -

i’d use color thief , script allows extract dominant color of image. unfortunately i’m not able code work. i’d dominant color background color of div called mydiv . here’s have far: http://jsfiddle.net/srd5y/4/ updated code / transfered own server due cross-linking issues: http://moargh.de/daten/color-thief-master/test.html js var sourceimage = 'https://www.google.de/intl/de_all/images/logos/images_logo_lg.gif'; var colorthief = new colorthief(); colorthief.getcolor(sourceimage); html <div id="mydiv"></div> thanks help! try based on code , mix of everyone's answers. need wait image load before using color theif. color photo1.jpg should [125, 190, 193] thanks @shadow wizard , @ejegg see official way ask jquery wait images load before executing something edit : ok use fiddle works http://jsfiddle.net/bgykt/ <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible&quo

c# - Play Sound in MonoTouch for specific duration -

using monotouch libraries, being able play sound specific duration , stop playback. must done on different thread ui. i've tinkered few different options, , i'm not entirely sure best course of action @ point. the classes this: public class foo { public string filename { get; set; } public string filepath { get; set; } public double duration { get; set; } public double pauseafter { get; set; } } public class fooplayer { public list<foo> foos { get; set; } public void playfoos() { foreach (foo f in foos) { //play sound //stop sound after duration has passed //wait duration specified in pauseafter //continue loop } } } i've been tinkering systemsound , avaudioplayer i'm yet required result. use timer, , after timer fires stop playback. similar question here , similar answer (use timer) in obj-c.

javascript - Add class to selected div (div is not unique) -

i have different divs have id="item" . when select 1 of divs , new class should added a div has been selected. there way when ids not unique? html: <div class="something" id="item"> <a href="#" class="something">...</a> </div> <div class="something" id="item"> <a href="#" class="something">...</a> </div> <div class="something" id="item"> <a href="#" class="something">...</a> </div> <div class="something" id="item"> <a href="#" class="something">...</a> </div> javascript (what have tried, not work): // changes links on website $("body").delegate('#item', 'click', function() { $( "a" ).addclass( "active" ); }); edit: using delegate function becaus

php - Ajax Method without XMLHttpRequest() Object -

i have 1 query ajax methodology. used work ajax use 4 simple lines written below: $.ajax({ type: "post", url: "/application/group/addmembers", data: {memberids: selectedmembers, groupid:<?php echo $this->groupid; ?>}, success: (function(msg) { // alert(msg); var ans = json.parse(msg); alert(ans['message']); // msg array returned php script in json }) }); now, when study more on different sites or tutorials. ajax creating xmlhtmlrequest(), used exchange information server. , more things open, send functions. but don't create xmlhtmlrequest object , ajax still works fine. want know difference. lose when don't communicate server using xmlhtmlrequest object. did search on it. still need answer. the difference between 4 simple line , xmlhttprequest() language xmlhttprequest() pure javascript while code above jquer

python - numpy.r_ is not a function. What is it? -

according numpy/scipy doc on numpy.r_ here , "not function, takes no parameters". if not function, proper term "functions" such numpy.r_ ? it's class instance (aka object): in [2]: numpy.r_ out[2]: <numpy.lib.index_tricks.rclass @ 0x1923710> a class construct used define distinct type - such class allows instances of itself. each instance can have properties (member/instance variables , methods). one of methods class can have __getitem__ method, called whenever append [something,something...something] name of instance. in case of numpy.r_ instance method returns numpy array. take following class example: class myclass(object) def __getitem__(self,i) return i*2 look @ these outputs above class: in [1]: = myclass() in [2]: a[3] out[2]: 6 in [3]: a[3,4] out[3]: (3, 4, 3, 4) i calling __getitem__ method of myclass (via [] parentheses) , __getitem__ method returning (the contents of list * 2 in case)- not class

git - Review changes from multiple commits -

i'm using git-svn work svn repository. 1 of things want able review changes git diff , nice options. sometimes, "work-in-progress" changes committed svn, , want wait until work finished before reviewing. i'm wondering if there's invocation of git diff let me see these related changes, without intervening commits. visually, have: * e00 yet more irrelevant stuff * a04 finish work * a03 more wip * d00 irrelevant stuff * a02 more wip * c00 other irrelevant stuff * a01 more wip * a00 start wip * b00 state of tree before wip starts i want able see cumulative effect of a** commits on top of b00 , without c00 , d00 , or e00 . git diff b00 a04 has irrelevant changes. git show a0{0,1,2,3,4} gives intermediate noise. i'd able without creating throw-away branch, current approach does. similar questions here , here . you need temporary place aggregate changes, current method fine. can use unnamed branch (a "detached head") mak

javascript - trouble querying 2 different lists from a SharePoint welcome page using ECMA -

my approach not working here. on welcome page of sharepoint 2010 document set , have placed script in content editor web part cewp. i've got block of jquery/javascript using following code. can 1 or other set of values 2 different blocks of code not both. seems duplicating of lines of code in tow queries causes things clash not sure can change make both sets unique or clashing between two. guidance appreciated. i'm going in circles right now. -dave i using 2 blocks differ @ listname. maybe page can support 1 of these? $(document).ready(function () { $().spservices({ operation: "getlistitems", async: false, camlrowlimit: 2000, listname: "personnel management", completefunc: fncallback }); }); function fncallback(xdata, status) { var index = 0; $documentlisttable = $("#documentlisttable"); //navigate t

unit testing - Best way to automate the verification of hundreds of standalone Java programs? -

i'm teaching assistant java course, , part of job grade ~100 java programming assignments each week, each consisting of 3-5 standalone java programs. students provided skeletal framework each problem (which makes names of packages/classes/methods identical), , have fill in logic methods. i wondering best way verify such submissions correctness, perhaps using junit (or similar frameworks) coupled script? before went ahead , did that, wanted know if there better approaches set system, change test cases (and corresponding class/method names) , able execute entire set of assignments? i'm looking pointers framework can this, though more welcome detailed solutions/similar instances of implemented framework! i think might via subversion. separate directory per assignment. students check in when they're ready, triggers junit test run. i'm not sure can away without writing code yourself. unit test have figure out code it's running, , run etc. not sure

c# - Why is my icon slightly higher than other ones? -

Image
in taskbar, icon of program slightly higher other programs: mine orange triangle, furthest 1 on left. all other icons lined perfectly, program wee bit higher them. this every icon i've tried , both when i'm debugging , running (as in, not started visual studio). the program's coded in c#. the image not higher doesn't fill entire area.

PHP shorthand for isset()? -

this question has answer here: what php shorthand for: print var if var exist 10 answers is there shorthand way assign variable if doesn't exist in php? if(!isset($var) { $var = ""; } i'd like $var = $var | ""; update php 7 (thanks shock_gone_wild ) php 7 introduces called null coalescing operator simplifies below statements to: $var = $var ?? "default"; before php 7 no, there no special operator or special syntax this. however, use ternary operator: $var = isset($var) ? $var : "default"; or this: isset($var) ?: $var = 'default';

osx - CoreFoundation functions in Mac OS X Assembly -

i have following code in assembly (assembled clang) updated thought cause alignment; still doesn't. updated again; code still seg faults suggestions(thank suggestions though stephen canon ) tried subtract 4, 8, 12 didn't work same stack realignment issue updated more info. .globl _main .data _hw: .asciz "hello world\n\0" .text _main: push 8 # 4 bytes push _hw # 4 bytes push 0 # 4 bytes ##https://developer.apple.com/library/mac/documentation/corefoundation/reference/cfstringref/reference/reference.html#//apple_ref/c/func/cfstringcreatewithcstring call _cfstringcreatewithcstring # 4 bytes ## push cfstr return value in eax sub esp, 8 # 8 bytes push eax # 4 bytes ##https://developer.apple.com/library/ios/documentation/corefoundation/reference/cftyperef/reference/reference.html#//apple_ref/c/func/cfshow call _cfshow # 4 bytes add esp, 8 # remove padding stack pointer mov eax, 99 ret program execution start of main stack empty =======

.htaccess - Remove www but do not affect subdomain (htaccess) -

rewritecond %{http_host} !^mysite.com$ [nc] rewriterule ^(.*)$ http://mysite.com/$1 [l,r=301] this strips www url. without rule subdomain works (blog.site.com). rule converts (site.com/blog) , shows 404 errors. what need keep affecting subdomain(s)? also, i'm curious if removing www. thing? i've heard doesn't matter long pick 1 , stick it. i'm using <link rel="canonical" ... /> re-enforce it. with (blog\.)? @ begin blog. becomes optional , redirect if different blog.mysite.com , mysite.com . rewritecond %{http_host} !^(blog\.)?mysite\.com$ [nc] rewriterule ^(.*)$ http://mysite.com/$1 [l,r=301] a different way same be: rewritecond %{http_host} !^mysite\.com$ [nc] rewritecond %{http_host} !^blog\.mysite\.com$ [nc] rewriterule ^(.*)$ http://mysite.com/$1 [l,r=301] which means if hostname different mysite.com , blog.mysite.com redirect. to avoid duplicity choose between www or non-www , redirect every thing that. so if

linux - Posting data to a form cURL -

Image
i trying post data form using curl , save in file , here form in want post data , webpage can accessed here form_webpage <label for='fldname'>name</label></td><td>:</td><td><input type='text' name='name' id='fldname'/> <label for='fldemail'>email</label></td><td>:</td><td><input type='text' name='email' id='fldemail'/> <input type='password' name='x' id='fldpwd'/> <input type='password' name='cpwd' id='fldcpwd'/> <input type='radio' value='m' name='gender' id='fldgendm'/> <label for='fldgendm'>male</label> <input type='radio' value='f' name='gender' id='fldgendf' /> <label for='fldgendf'>female</label> <input type='checkbox&#

excel - How to clean up a VBA code -

i have following code contributor these forums wrote me, i've modified want. know can shortened, vba skills extremely basic. the code adds summary of row. thank you. public sub sumcages() dim current_row, summary_row, item_total integer current_row = 45 summary_row = 44 while sheet8.cells(current_row, 7) <> "" if isnumeric(sheet8.cells(current_row, 7)) item_total = item_total + val(sheet8.cells(current_row, 7)) else summary_row = summary_row + 1 ' advance summary_row if item_total > 0 sheet8.cells(summary_row, 8) = item_total ' display total current_row = current_row - 1 ' correct advancement else sheet8.cells(summary_row, 8) = sheet8.cells(current_row, 7) ' copy label end if item_total = 0 ' reset item_total end if current_row = current_row + 1 ' advance current_row wend sheet8.cells(summary_row + 1, 8) = item_total current_row = 45 summary_row = 44 while sheet8.cells(current_r