Posts

Showing posts from August, 2012

webforms - Visual Studio 2012 hangs when opening site.master -

i using visual studio 2012 ultimate 11.0.60315.01 update 2 under windows 7 pro. have been doing non visual development while no issues. have created fresh web forms application. go open site.master in "design view" in html editor vs freezes. the freee results in me being unable click elsewhere in ide (menu's, solution explorer) etc. not if ide has hung, rather has stopped responding. same behaviour evident if run devenv.exe /safemode. cpu usage minimal , have plenty of ram available. any suggestions on how diagnose , resolve issue? running vs administrator seems alleviate problem.

iphone - How to increase the Label value separately in each row,table contains so many Sections -

Image
i have uitableview number of sections , rows. when user selects cell, how perform actions of plus , minus buttons in viewcontroller? mean increase label value each row separately? - (nsarray *)sectionindextitlesfortableview:(uitableview *)tableview { nsarray *tobereturned = [nsarray arraywitharray: [@"a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" componentsseparatedbystring:@"|"]]; return tobereturned; } //cell row - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *myidentifier= @"myidentifier"; locationscustomcell *cell= (locationscustomcell *)[tableview dequeuereusablecellwithidentifier:myidentifier]; if(cell==nil) { [[nsbundle mainbundle] loadnibnamed:@"locationscustomcell" owner:self options:nil]; cell=locationcustomcell; } @try { i

python - How can I prevent user entered password from showing on screen? -

this question has answer here: how clear screen in python [duplicate] 1 answer i trying create utility program, after password correctly typed in goes main screen, , shows password right above it! there way can automatically make program clear shell before goes main menu? you can use subprocess module execute "clear" (linux/mac) or "cls" (windows) command based on os. >>> import subprocess,sys >>> if sys.platform in ("linux2", "linux", "darwin"): #for linux / mac ... subprocess.call("clear") ... elif sys.platform.statswith("win"): #for windows ... subprocess.call("cls") list of possible sys.platform values: system platform value linux (2.x , 3.x) 'linux2' linux (py 3.3) 'linux' windows 'win

ios - Unsupported format or combination of formats (Only 8-bit, 3-channel input images are supported) in cvWatershed -

hi new image segmentation, trying given code foreground objects, got error "unsupported format or combination of formats (only 8-bit, 3-channel input images supported) in cvwatershed" cv::mat img0 = [img tomat]; cv::mat img1; cv::cvtcolor(img0, img0, cv_rgb2gray); cv::threshold(img0, img0, 100, 255, cv::thresh_binary); cv::mat fg; cv::erode(img0,fg,cv::mat(),cv::point(-1,-1),6); cv::mat bg; cv::dilate(img0,bg,cv::mat(),cv::point(-1,-1),6); cv::threshold(bg,bg,1,128,cv::thresh_binary_inv); cv::mat markers(img0.size(),cv_8u,cv::scalar(0)); markers= fg+bg; // cv::namedwindow("markers"); // cv::imshow("markers", markers); watershedsegmenter segmenter; segmenter.setmarkers(markers); cv::mat result1 = segmenter.process(img0); // cv::mat result1; result1.convertto(result1,cv_8u); uiimage * result = [uiimage imagewithmat:result1 andimageorientation:[img imageorientation]]; return result; and try debugging , got error in line cv::mat res

delphi - How to send message to another computer in Workgroup -

i using delphi xe3. i want send message pc in workgroup (lan connection). how can it? , component should use? hey remember old days use write on command prompt: net send [machine name] message this works smile :) if machine name doesn't work try ip. just check if using directory services permission of cmd command , net send command should there. if no directory services, works charm.

java - Any FSM/FSA Based Tagger -

there several taggers around. asked question creating own tagger , have got requirement now. in python using topia , seemed great choice job (fast , concise). there no such alternative in java,i find. now, have 3 questions related : 1)is there term extractor/pos tagger in java based on fsm? 2) fsm tagger "can be" more efficient (i know way faster, accuracy) corpus based taggers? 3) how start building 1 in java? basic guide creating machine extracting pos tags sentence :- "einstein great scientist." ? start ?

mysql request order by where -

im confused, have simple request doesnt work... 'select * articles status = "2" order time_added desc limit $start, $num' $start , $num pagination it works if do: 'select * articles status = "2"' or: 'select * articles order time_added desc limit $start, $num' i know, simple stucked with, i'm stucked. please, help. thank time.

java - how to open pop up in new window using javafx web view -

i trying implement popup handler in javafx webview generating popup , adding on same fxpanel want display onto new window . using following code. try { webview webview,smallview final group group= new group(); scene scene= new scene(group); fxpanel.setscene(scene); webview = new webview (); group.getchildren().add(webview); eng= webview.getengine(); string url ="http://www.timetrim.in/webchatserver2/default.aspx"; eng.load(url); smallview = new webview(); smallview.setprefsize(400, 200); eng.setcreatepopuphandler( new callback<popupfeatures, webengine>() { @override public webengine call(popupfeatures config) { smallview.setfontscale(0.8); if (!group.getchildren().contains(smallview)) { group.getchildren().add(smallview); } return smallview.getengine(); } }); } catch(exception ex){ex.pri

Replacing %1 and %2 in my javascript string -

this question has answer here: javascript equivalent printf/string.format 42 answers javascript multiple replace [duplicate] lets have following string in javascript code: var mytext = 'hello %1. how %2?'; now inject in place of %1 , %2 in above string. can do: var result = mytext.replace('%1', 'john').replace('%2', 'today'); i wonder if there better way of doing calling 2 times replace function. thanks. how little format helper? that's need: function format(str, arr) { return str.replace(/%(\d+)/g, function(_,m) { return arr[--m]; }); } var mytext = 'hello %1. how %2?'; var values = ['john','today']; var result = format(mytext, values); console.log(result); //=> "hello john. how today?" demo: http://jsbin.com/uzowuw/1

c++ - constructor overloading. Getting the wrong solution -

#include <iostream> #include <conio.h> using namespace std; class crectangle { int * height, * width; public: crectangle(); crectangle(int, int); crectangle(); int area() { return (*height * *width); } }; crectangle::crectangle() { *height = 3; *width = 5; } crectangle::crectangle(int a, int b) { height = new int; width = new int; *height = a; *width = b; } crectangle::~crectangle() { delete height; delete width; } int main() { crectangle rect(1, 2); crectangle rectb; cout << "rect = " << rect.area() << "\n"; cout << "rectb = " << rectb.area(); getch(); } i getting area rect "6", instead of "2". can please point out mistake. only 1 of constructors allocates memory width , height. other 1 has undefined behaviour.

loops - Iterate over columns of a report to dynamically show/hide them? -

Image
i want try , implement parameter allow users dynamically choose columns going shown in report. idea create multiple value parameter has column names. after user hit view report want try iterate on columns , selected values join visibility. how can iterate on columns inside tablix? how can iterate on multiple values of parameter, can find if value selected or not? i using ms sql reporting services 2012. for table, i.e. fixed columns, can use following approach. it's not loop based individual distinct visibility check each column based on parameter selection. set multi-valued parameter lists columns can displayed/hidden. then, each of these columns in actual table, set column visibility use expression based on parameter: the expression like: =iif(instr(join(parameters!includedcolumn.value, ","), "col1") > 0, false, true) what doing constructing string of selected values includedcolumn parameter, checking if column identifier inc

android - In java How to merge two different size arraylist and make a new Arraylist? -

Image
i have 2 arraylist name prebusinesslist, businesslist. in business list have data server, , in prebusinesslist local one. in lists have id, count value betterly demonstrate below now wanted make newbusinesslist this how can in java, please me solve assumming understood problem correctly (big if...): also, assume each element in lists pair - looks data (just dumb wrapper class holds 2 integers). if other class you'll need adjust code. private map<integer,integer> finalvalues = new hashmap<integer,integer>(); (pair<integer,integer> entry : prebusinesslist) { finalvalues.put(entry.getfirst(), entry.getsecond()); } //2nd list overwrites values 1st (anything not overwritten remains) (pair<integer,integer> entry : businesslist) { finalvalues.put(entry.getfirst(), entry.getsecond()); } arraylist<pair<integer,integer>> finallist = new arraylist<>(); (map.entry<integer,integer> entry : finalvalues) { final

How to diagnose errors in LaTeX generated by Doxygen 1.8.x: LT@LL@FM@cr -

i've been using doxygen generate pdf documentation sizable fortran 90 project since v1.6. after recent upgrade doxygen 1.8, pdflatex choking error can't understand. refman.log: . . . <use classfate__source_a022bf629bdc1d3059ebd5fb86d13b4f4_icgraph.pdf> package pdftex.def info: classfate__source_a022bf629bdc1d3059ebd5fb86d13b4f4_ic graph.pdf used on input line 607. (pdftex.def) requested size: 350.0pt x 65.42921pt. ) (./classm__aerosol.tex ! undefined control sequence. <recently read> \lt@ll@fm@cr l.25 ...1833ffa6f2fae54ededb}{ia\-\_\-nsize}), \\* ? ? type <return> proceed, s scroll future error messages, r run without stopping, q run quietly, insert something, e edit file, 1 or ... or 9 ignore next 1 9 tokens of input, h help, x quit. looking @ first 25 lines of classm__aerosol.tex, nothing matches error message: \hypertarget{classm__aerosol}{\section{m\-\_\-aerosol module reference} \label{classm__aerosol}\index{m\-\_\-aerosol@{m\-\_\

pagination - Redirect to paginated page after form submit - Django -

i use paginator create series of pages meet criteria. each page contains form user can submit. when form submitted, them stay on/return page were. how do that? i've searched everywhere , read docs, can't find answer. i'm sure problem in front of computer, please :) following view should this: def assignment(request, pk): """view each assignment""" if request.user.is_authenticated(): #### correct articles assignment = get_object_or_404(assignment, pk=pk) country = assignment.country.ccode start_date = assignment.start_date end_date = assignment.end_date articles = article.objects.filter(country=country).filter(pub_date__range=(start_date,end_date)) paginator = paginator(articles, 1) #### pagination #### page = request.get.get('page') try: articles = paginator.page(page) except pagenotaninteger: articles = paginator.page(1) except emptrypage: articles = p

javascript - Accessing local file system on browser -

please hear me out before start crying security issues. this intranet application, hence have full range install plugins or change security permissions suit. what want them go webpage , click link download file, such word document. gets transferred local storage of kind (sandboxed if need be) , opened in word regular file. when click save, javascript or pickup file saved or program no longer accessing , can actioned upon, such uploading server. is there way this. have looked @ indexeddb, webstorage, html5 filesystem api new , don't see way this. i open coding needed plugins long don't mention flash. main issue coming across opening file downloaded form of local browser , opening via desktop application, e.g. word. any help, appreciated. after research way plugin. indexeddb, filesystem api or webstorage can not access local file system. good. silverlight option intranet , .net, have chosen go with. silverlight 5 in full permissions file watcher. file

php - What's the difference between Gearman's job and task? -

i'm trying understand gearman until can't figure out what's difference between task , job. i'm trying create client parse periodically (every 10 minutes) xml page. best approach? the manual offers terrific explanation : jobs vs. tasks a task request or communication between client , job server. task communication about job. tasks might please run job or what status of job . job worker does, continuously waiting on job server tell him when start , arguments. clients submit jobs , ask status jobs (both of things considered tasks). workers perform jobs.

solr - How to return Search Result Score using Solrnet -

we using solrnet api index , search set of documents. corresponding poco representing solr document is internal class indexdocument { [solrfield("docid")] public long docid { get; set; } [solrfield("doctitle")] public string doctitle { get; set; } [solrfield("content")] public string content { get; set; } } we can index data , return search results. requirement return relevance score of result items along solr document attributes. can return score data adding "score" field in search request solr. issue how accept score data in solr results since not part of solr document class. use following snippet execute search: solrqueryresults<indexdocument> results = solrinstance.query(query, options); we can score data returned when execute query solr admin interface how return score data in results object since search results returned in terms of indexdocument class. other parameters of solrqueryresults class gr

Facebook page - how can i get all albums using javascript sdk? -

i have facebook page , photos , albums public. i've used query albums: https://graph.facebook.com/67695062976/albums now query writes error: an access token required request resource. my javascript function albums: getalbums: function() { $.get('http://graph.facebook.com/67695062976/albums?callback=?', { }, function (res) { $('#albumscontent').html(""); $.each(res.data, function (key, value) { var image = res.data[key]; $('#albumscontent').append('<div class="photosalbums"><a id="buttonphotosalbums'+image.id+'" href="album-'+image.id+'"></a><div class="photosalbumsname">'+image.name+'</div></div>'); }); }, "json"); }, how can fix problem in javascript side? you need

java - JFrame acting strangely. Sporadically displays JLabel -

its hard explain whipped out phone , video'd problem i'm having: http://www.youtube.com/watch?v=kdoende8w2q simply put, image (border @ bottom can see, implemented jlabel) should remain there @ times, instead appears 1 second, disappears , flashes sporadically. import java.awt.button; import java.awt.dimension; import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; import javax.swing.imageicon; import javax.swing.jframe; import javax.swing.jlabel; import org.imgscalr.scalr; import com.github.sarxos.webcam.webcam; import com.github.sarxos.webcam.webcampanel; import com.github.sarxos.webcam.webcamresolution; public class webcampanelexample extends jframe { static webcam webcam; static jframe window; public static void main(string[] args) throws ioexception { window = new jframe("test webcam panel"); dimension[] nonstandardresolutions = new dimension[] {

asp.net - Opening CSS modal dialog using javascript -

i have following modal dialog (popup) using css3 in asp page user registration: html : <%-- modal popup starts here--%> <div id="openmodal" class="modaldialog"> <div> <a href="#close" title="close" class="close" onclick="disableallpopuptxt()">x</a> <table style="width:100%;"> <tr> <td style="text-align: center; width: 100%;"></td> </tr> <tr> <td style="text-align: center; width: 100%;"> <asp:label id="lblerrormsg2" runat="server" font-bold="true" forecolor="#ff3300" text="email id taken " visible="false"></asp:label> </td> </tr> <tr> <td style="text-align: center; width: 100%;"> <input id="txtcustfname" name=

java - Adding a word into a custom Dictionary from a SpellCheckerService -

Image
i implementing ime customized dictionary , id create spellcheckerservice well. integration trivial cannot seem find documentation on how add non existant words dictionary. button there, upon click sends me devices custom words list not want do. want add word structures. dont see overridable methods in spellcheckerservice nor session class. is there way achieve this? edit: added picture of want override clarification well found out. the word editor activity has have in manifest: <intent-filter> <action android:name="com.android.settings.user_dictionary_insert" /> <action android:name="com.android.settings.user_dictionary_edit" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.voice_launch" /> </intent-filter> source: the android app source code

c++ - Checking for this == NULL in a member-function without invoking undefined behaviour -

suppose have c++ class , have recursive member-function called instances items of class, example // eplicit "this" clarity in following code: void recursiveprinttree(){ (if == null){ // "out" of tree return; } cout << this->val; (this->leftson)->printbinarytree(); (this->rightson)->printbinarytree(); } the problem of course invoking undefined behaviour calling printbinary null in first place! avoid this, , far know have @ least 3 ways of doing so: 1) using static member functions, explicit this-type argument can safely checked. did far because it's recursive implementation, of member-functions coded static. that's not good, right? 2) checking stop condition next node before having recursive call null pointer possibly "this". less natural form of writing , checks other items other this. , avoid it. 3) using default dummy values. tried it, felt it's not saving me special-case-treat

javascript - easyui populate datagrid data based on combobox value -

i'm using http://www.jeasyui.com . i need populate datagrid based on values combobox. i populate combobox with, <input id="listcombo"class="easyui-combobox" name="lo_client_id" data-options="url:'get_lists.php',valuefield:'id',textfield:'listname',panelheight:'auto'"> and working fine. datagrid looks like, <table id="dg" title="my numbers" class="easyui-datagrid" style="width:500px;height:250px" url="get_users.php toolbar="#toolbar" pagination="true" rownumbers="true" fitcolumns="true" singleselect="true"> <thead> <tr> <th field="number" width="50">numbers</th> </tr> </thead> </table> when give url = "get_users.php?id=1 gives me required results, id should dynami

java - Address family not supported by protocol family - SocketException on a specific computer -

in app have programmed, have java.net.socketexception on specific computer: java.net.socketexception: address family not supported protocol family: connect this specific computer runs windows 7 32 bit , connected internet through local area connection (ethernet). app runs correctly on other computers, windows 7 , windows 8, connected through local area connection or through wi-fi, not sure problem programmatic. have tried check protocols of local area connection, didn't see problems. can please me understand problem? why exception thrown? try check whether spy program called "relevantknowledge" installed. uninstallation helped me solve problem.

java - Multiple value as key in Map Collection -

problem: storing sql statements of table in map pk value of table maps corresponding insert/select statement. came across table uses composite key(4 pk ) . now base of logic shaken far read array cannot used key in map there way can on come ? i declaring map below map<string, string> pkmap= new map<string, string>(); where key primary key of table . note: processing few tables in db not of them have 4 pk composite key few may have 2 or 1 you use list<string> key (or list<object> if want support heterogeneous types). 2 lists equal if have same size , if members equal.

How to capture a sequence of key presses and then fire an event in Qt? -

i know how fire event on key press in qt. need handle sequence. fire event when user presses ctrl alt t . how can capture sequence? tell me how can detect keys pressed. create qaction , add required key sequence setshortcut(const qkeysequence& shortcut) . associate qaction calling qwidget::addaction(qaction* action) , , can create appropriate signal/slot connections between qaction , qwidget .

php - Code does not work without disabling SSL -

Image
please take @ code: <?php $url = "the_source_url"; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt ($ch, curlopt_ssl_verifypeer, false); $result = curl_exec($ch); print_r($result); ?> this page accessed android app date source. url returns json data, print back, then, in app, process data , display it. working fine me right (i'm still in testing phase). i read in disabling ssl (whih did in line 6) risky , not recommended . however, couldn't make script work unless disable it. how make work without disabling ssl? or how eliminate risk? disabling certificate make vulnerable man in middle attack, can download use certificate curl_setopt ($ch, curlopt_ssl_verifypeer, true); curl_setopt($ch, curlopt_ssl_verifyhost, 2); curl_setopt ($ch, curlopt_cainfo, "path_to_certificate/cert.pem"); to certificate follow guide then click on “view certificate”: bring “detail

ruby on rails - How to set the timezone and get the time all in one line of code? -

time.zone = 'hawaii' # => "hawaii" time.zone.now # => wed, 23 jan 2008 20:24:27 hst -10:00 i time.zone('hawaii').now time.now.in_time_zone("hawaii")

iTextSharp difference between implicit explicit NewPage -

i use onstartpage event handler write header, works great, need know whether issued newpage() or issued due page overflow. there elegant way tell? in advance help! you've written page event implementation, , you've implemented 1 or more of methods. create instance of event this: mypageevent event = new mypageevent(); writer.setpageevent(event); whenever onstartpage() called, want know if called within itext or code using newpage() method. itext uses same newpage() method internally, you'll have use trick. add membervariable page event application. like: protected boolean mynewpage = false; now add method event: public void newpage(document document) { mynewpage = true; document.newpage(); mynewpage = false; } now whenever want trigger new page, don't use: document.newpage(); use instead: event.newpage(document); the onstartpage() method called internally every new page initialized, , @ moment, value of mynewpage true

c++ - What is the Windows RT on ARM native code calling convention? -

i couldn't find documentation on windows rt on arm calling convention used visual studio c++. microsoft using arm's aapcs ? if microsoft using aapcs/eabi windows rt on arm, using arm's c++ abi (which derived itanium c++ abi)? maybe arm exception handling abi ? does calling convention used windows rt on arm differ used other (embedded) arm windows variants? is there reliable way detect windows rt on arm through predefined compiler macros? update: added question regarding c++ abi. unlike windows ce (which uses original apcs aka old abi), windows rt on arm uses eabi. more specifically, variant uses floating-point registers pass floating-point data , 8-byte stack/argument alignment. if take following function: int g(float x) { return x; } and compile vs2012's arm compiler, following assembly: |g| proc vcvt.s32.f32 s0,s0 vmov r0,s0 bx lr endp ; |g| you can see it's using s0 , not r0 argument. the 1 v

c# - What Event is used for Maximizing and Minimizing? -

this question has answer here: how detect when windows form being minimized? 4 answers what event used maximizing , minimizing windows form? want show message box when form maximizes , comes out of minimizing mode. this tested code private void form1_resize(object sender, eventargs e) { if (windowstate == formwindowstate.minimized) { messagebox.show("minimize"); } else if (windowstate == formwindowstate.maximized) { messagebox.show("maximize"); } }

c++ - is this possible to inherit private class but make members public? -

i want have members inherited private. think saw example of making them public nevertheless fact derived private keyword. question: how it, , if possible shouldn't prohibited? class u{ public: int a; protected: int b; private: int c; }; class v : private u{ public: int i; //can make public again? }; how it? perfectly possible, use using keyword. shouldn't prohibited? no need. can return members back accessibility not more initially . so, if base class has declared public , idea/restriction make private, doesn't hurt base class if drop restriction , leave public, in public @ beginning. cite "c++ programming language" best here. a using-declaration cannot used gain access additional information. mecha- nism making accessible information more convenient use . so if accessible in base class, , derived class protected or private keyword can remove restriction , return them initial level of access "

android - How to know if MediaScanner is enabled? -

i don't mediascanner android system , how implemented, battery consumption, card not reachable, etc, made directory based image viewer. know how disable (enable) scanner console this: su & pm disable (enable) com.android.providers.media/com.android.providers.media.mediascannerreceiver now, want java code of viewer. of course can runtime.getruntime().exec(...) , have questions: 1) there way of doing without runtime.getruntime().exec() ? 2) how can know if mediascannerreceiver enabled or disabled? googled , couldn't find anwser. mediascannerconnection not seem control this. actually, don't know pm does... 3) possible without root access? thanks! part 2). main question, , solution: componentname sc = new componentname("com.android.providers.media", "com.android.providers.media.mediascannerreceiver"); int isenabled = getpackagemanager().getcomponentenabledsetting(sc); if (isenabled == packagemanager.component_ena

c++ - sort n-dimension point and keep track of original index -

i have set of n- dimension point store in vector< vector<double> > ex a[0][1].............[n], , a[0][0] = x, a[0][1] = y, a[0][2] = z and want sort vector of of dimension ex sort x, y, z ,.........n in ascending order ex a[0] = (1,5,3), a[1] = (3,2,1) a[2] = (2,8,4) after sorting index: 0 1 2 a[0] = (1,5,3), a[1] = (2,8,4) a[2] = (3,2,1) original index : 0 2 1 i find sort(vector.begin(), vector.end()) can sort how can record original index additional vector? is there algorithm or c++ feature can solve it? thx in advance. you need somehow keep information index. can see 2 ways of doing : 1-since represent point vector, can had dimension represent orginal index : //adding index info, inportant index last dimension , otherwise sort incorrect for(auto point = vector.begin(),unsigned int index=0;point != vector.end(); ++point,++index){ point-&

Error when parsing attributes with python minidom -

i have structure in xml file: <questions> <q question="where jim , mother going?" answer="the school"/> <q question="what color ball?" answer="orange"/> i trying parse minidom in python questionsblock = s.getelementsbytagname('questions') questions = questionsblock[0].getelementsbytagname('q') counter = 1 q in questions: question = q.attributes['question'].value answer = q.attributes['answer'].value and getting error: file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/xml/dom/minidom.py", line 524, in __getitem__ keyerror: 'answer' what missing here? as far can tell code posted, there absolutely nothing wrong. however, considering xml provided in extract, , not show </questions> closing tag, suspect there may q element somewhere missing answer attribute.

git - Listing file names from an old commit -

i have deleted several files repository long time ago. years later want @ them. if know names of 1 of files, can @ history 1 of them using: git log -- path/to/file if want see version of file old commit, use this: git show commit:path/to/file but of assumes know path/to/file, don't. there way list files existed @ time, given commit? i realize can repeatedly until find it: git checkout -- commit but complete file list old commit ideal. such capability exist? given comprehensiveness of git, i'll bet there is, surely don't know it. you can find commits deleted files like: git log --diff-filter=d --name-only --oneline --diff-filter=d selects files deleted --name-only shows filenames --oneline uses one-line commit description

python - Putting 2D coordinate system to 3D via matplotlib -

i pretty new programing in python , have question. want draw 2d coordinate space in 3d add points in space , show rotations around (0,0) (2,1) of 2d space 90°,120° , 60°. problem don't know how draw 2d coordinate space in 3. can suggest me solution how place 2d in 3d using matplotlib? here example of code i've made far... from mpl_toolkits.mplot3d import axes3d import numpy np import matplotlib.pyplot plt fig = plt.figure() ax = fig.add_subplot(111,projection='3d') x = 2 y= 1 ax.scatter(x, y, 0, zdir='y') #size of 3d ax.legend() ax.set_xlim3d(0, 10) ax.set_ylim3d(0, 10) ax.set_zlim3d(0, 10) plt.show() you might want @ examples found on mplot3d tutorial http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#tri-surface-plots

Run local java applet in browser (chrome/firefox) "Your security settings have blocked a local application from running" -

Image
i'm trying run java applet (html file), browser keeps saying: "your security settings have blocked local application running" i have tried using chrome , firefox same error. have upgraded latest version of java, chrome still says in chrome://plugins/ "download critical security update" even though can run java applets (not locally) im using ubuntu 13.04 64 bit after reading java 7 update 21 security improvements in detail mention.. with introduced changes no end-user able run application when either self-signed or unsigned. ..i wondering how go loose class files - 'simplest' applets of all. local file system your security settings have blocked local application running that dialog seen applet consisting of loose class files being loaded off local file system when jre set default 'high' security setting. note slight quirk of jre produced on point 3 of. load applet page see broken applet

How are HTTP requests handled in Java Web Services? -

i new web services , going through book java webservices martin kalin. have gone through initial basic concept of , have question: say producer sends http request (containing soap message envelope) java web service ( consumer ). request internally handled servlet extracts soap message , convert corresponding java domain object , service implementation bean called? this question generic irrespective of off shelf framework metro , axis. consider below code endpoint.publish("webserviceurl", new customerserviceimpl()) now if consumer sends request webserviceurl , handled servlet @ entry point or handled in other way? (as how web request handled in web application) requests handled can handle http requests, period. it's convenient use servlets or filters because plumbing has been written in form of servlet/application container, isn't requirement. example, service running on netty wouldn't need follow servlet spec. (although iirc there's l

regex - Detect if string is number or has decimal value in javascript -

i need users enter amount , may come in different formats 500 or 500.00. need check if user has entered number or number 2 decimal points. far have tried if(/^\d+$/.test(amount) === false || /[0-9]+(\.[0-9][0-9]?)?/.test(amount) === false){ //valid }else{ //invalid } but far 1 check if number working fine. i guess looking this var pattern=/^\d+(\.\d{2})?$/; if(pattern.test(amount)) { //valid number pattern } else { //invalid number pattern } \d+(\.\d{2})?$ match 1 many digits optionally followed 2 decimal values..

ios - Issue with UIControlEventTouchDragOutside implementation -

i have 2-d button array in main view , want able move them dragging inside view. buttons pretty narrow, around 23x23 pixels. have added targets control events touchdragexit , touchdragoutside fired many pixels after moved finger outside button. hence subclassed uibutton , overrode continuetrackingwithtouch code found in so. notice don't call superclass implementation. -(bool)continuetrackingwithtouch:(uitouch *)touch withevent:(uievent *)event { cgfloat boundsextension = 5.0f; cgrect outerbounds = cgrectinset(self.bounds, -1 * boundsextension, -1 * boundsextension); bool touchoutside = !cgrectcontainspoint(outerbounds, [touch locationinview:self]); if(touchoutside) { bool previoustouchinside = cgrectcontainspoint(outerbounds, [touch previouslocationinview:self]); if(previoustouchinside) { [self sendactionsforcontrolevents:uicontroleventtouchdragexit]; } else { [self sendactionsfor

Spring retrieving one user by id -

i have on page list of users retrieved database. along users associated child objects, on same page instead of list of users, 1 user logged in application. restricted viewing of user details , should able view own specific details , child objects. dao - method getting users public list<module> getsettermodules(integer userid){ session session = sessionfactory.getcurrentsession(); query query = session.createquery("from userentity u u.userid="+userid); userentity userentity = (userentity) query.uniqueresult(); return new arraylist<module>(userentity.getsmodule()); the dto retrieving list of users , associated objects retrieve 1 user (that authenticated) id , list of objects linked them. i'm attempting implementing this: @requestmapping(value = "/main", method = requestmethod.get) public string getrecords(@requestparam("userid") integer userid, modelmap model) { //retriev

java - I need to hold multiple int values in a Map -

i need create book index method can pair multiple values 1 key e.g key - "beck,kent" value - 27 23 76 is possible? the import ou.*; open university library , should not affect anything. import java.util.*; import ou.*; public class bookindex { public map<string, integer> index() { map<string, integer> actual = new hashmap<>(); return actual; } thanks how using integer array instead of integer in map<string, integer> . hashmap<string, integer[]> anewmap = new hashmap<string, integer[]>(); anewmap.put("beck,kent",new integer[] { 27, 23, 76});

Use SWIG to wrap C++ <vector> as python NumPy array -

i have c++ library defines following (and more them) types: typedef std::vector< double > doublevec; typedef std::vector< doublevec > doublevecvec; typedef std::vector< int > intvec; typedef std::vector< intvec > intvecvec; i trying create python interface library handles objects that. title states, interface convert to/from c++ std::vector , numpy ndarray . i have seen both numpy.i provided numpy people , std_vector.i swig people. problems numpy.i created handle c/c++ arrays (not c++ vectors) , std_vector.i doesn't conversion directly to/from numpy arrays. any ideas? i have seen fenics project has done this, project large having hard time finding out how specific task. try starting point. %include "numpy.i" %apply (size_t dim1, double* in_array1) {(size_t len_, double* vec_)} %rename (foo) my_foo; %inline %{ int my_foo(size_t len_, double* vec_) { std::vector<double> v; v.insert(v.end(), vec_, vec_

c# - Could not load file or assembly ' Version=3.0.1.0, PublicKeyToken=null or one of its dependencies.A strongly-named assembly is required. -

in application after giving assemblies strong key names including third parties dlls vs 2012 command prompt assembly loading error. could not load file or assembly ', version=3.0.1.0, culture=neutral, publickeytoken=null' or 1 of dependencies. strongly-named assembly required. (exception hresult: 0x80131044) fileloadexception: not load file or assembly 'clubstarterkit.core, version=3.0.1.0, culture=neutral, publickeytoken=null' or 1 of dependencies. strongly-named assembly required. (exception hresult: 0x80131044)] system.signature.getsignature(void* pcorsig, int32 ccorsig, runtimefieldhandleinternal fieldhandle, iruntimemethodinfo methodhandle, runtimetype declaringtype) +0 `system.reflection.runtimemethodinfo.get_returntype() +42 `system.web.httpapplicationfactory.reflectonmethodinfoifitlookslikeeventhandler(methodinfo m) +19` system.web.httpapplicationfactory.reflectonapplicationtype() +374 system.web.httpapplicationfactory.compileapplication() +143`

java - How to find the median of a large number of integers (they dont fit in memory) -

i know answer using median of medians can explain how it? there linear time algorithms this, page might helpful, http://en.wikipedia.org/wiki/selection_algorithm , if still confused ask basically way selection algorithm works quicksort sorts on side of pivot each time. goal keep partitioning until choose pivot equal index of element trying find. here java code found quickselect: public static int selectkth(int[] arr, int k) { if (arr == null || arr.length <= k) throw new error(); int = 0, = arr.length - 1; // if == reached kth element while (from < to) { int r = from, w = to; int mid = arr[(r + w) / 2]; // stop if reader , writer meets while (r < w) { if (arr[r] >= mid) { // put large values @ end int tmp = arr[w]; arr[w] = arr[r]; arr[r] = tmp; w--; } else { // value smaller pivot, skip r++; } } // if stepped (r++) need step 1 down if (arr[r] > mid) r--; // r pointer on end of first k elemen

ember.js - How is ApplicationController automatically generated? -

the ember.js apps app = ember.application.create(); and app = ember.application.create(); app.applicationcontroller = ember.controller.extend(); do same because ember automagically generates applicationcontroller. correct? so why can access app.applicationcontroller in javascript console second app not first one? when automagically generated should able access in console. wrong assumption? it's created in both cases, try in javascript console: //use debug purposes app.__container__.lookup('controller:application'); this should give applicationcontroller instance in both cases altough define controller so: app.applicationcontroller = ember.controller.extend(); if want hook controller hope helps

ios - Conditional overlapping view transparency? -

Image
i have few moving views semi-transparent, @ point overlapping. possible make overlapped part "invisible" through top view? example, 3 uiviews background (which stationary) , 2 subviews (the semi-transparent ones) , when overlap lower subview "invisible" under top subview, while can still see background view , part of lower subview isn't overlapping other view. here's image clarify before , after overlap. before overlap: after overlap: (the view on far right looks little strange because blends white background)

how to create horizontal scrollable buttons list in android -

i new android.i want create dynamic horizontal buttons list scrollbar using arrya list in android.ie source.when press button want position of button.please me. what believe talking horizontallistview . there library projects created can use in project try these out.

html - Center absolute position div in windowed mode? -

i centered absolute div: <div style=" width:800px; height:190px; position:absolute; left:50%; margin-left:-400px; border-width:10px; border-style:solid;"> </div> in maximized mode, works normally. when width of browser smaller div, can't scroll left of div, cut. tested on chrome , ie9 how can center absolute div in windowed mode? reason out of alignment? you'll want change div 's width , height percent values , center it, this: top:0; left:0; right:0; bottom:0; margin:auto; position:absolute;

scheme - a strange error in racket "no expression after a sequence of internal definitions" -

i have following code: (define (play-loop strat0 strat1 strat2 game-limit) (define (play-loop-iter strat0 strat1 strat2 count history0 history1 history2 limit) (cond ((= count limit) (print-out-results history0 history1 history2 limit)) (else (let ((result0 (strat0 history0 history1 history2)) (result1 (strat1 history0 history1 history2) (result2 (strat2 history0 history1 history2))) (play-loop-iter strat0 strat1 strat2 (+ 1 count) (extend-history result0 history0) (extend-history result1 history1) (extend-history result2 history2) limit))))) (play-loop-iter strat0 strat1 strat2 0 '() '() '() game-limit))) when run in racket gives me following error: begin (possibly implicit): no expression after sequence of internal definitions in:... i seems ok there error , looked me interesting.

php - How to limit a form submission rate per user -

i trying limit form's submission rate 1 per user per 120 seconds. i thinking using $_session variable, i'm not sure how work, , cookies can deleted. guess $_session variable worked around intuitive user logging out , in. i'm theorizing @ moment not have code. how around problem? edit -- the reason user querying because item , bestiary database. need slow down user queries acceptable rate because going on rate of 10 queries/minute or else application may "banned" or denied hour. $_session , $_cookie variables removed user, , therefore abused them. need store submits somewhere on server. perhaps mysql. check before processing form. something like select count(*) attempts, max(submit_time) last form_submits user_id = ? , submit_time > - interval 2 minute then if ($row['attempts'] > 0) { echo "you must wait " . (time() - strtotime($row['last'])) . " seconds before can submit form again.&

design patterns - Application upgrade in a high availability environment -

i writing nosql database engine , want provide features developers upgrade application new version without stopping operation of website, i.e 0% downtime during upgrade. question is, methods or general design of web application when run 24/7 , changing database structure often? examples or success stories appreciated. with nosql - , document oriented database - can accomplish versioning. consider mongodb, stores documents. mongodb allows have collection (a group of documents) schema every document can different. let's have document user: { "_id" : 100, "firstname" : "john", "lastname" : "smith" } you have document in same collection: { "_id" : 123, "firstname" : "john", "lastname" : "smith", "hasfoo" : false } different schemas, both in same collection. different traditional relational database. the solution add field ever

python - How to use different view for django-registration? -

i have been trying django-registration use view registrationformuniqueemail , following solution django-registration question . have set urls.py from django.conf.urls import patterns, include, url registration.forms import registrationformuniqueemail django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), (r'^users/', include('registration.backends.default.urls')), url(r'^users/register/$', 'registration.backends.default.views.registrationview', {'form_class': registrationformuniqueemail, 'backend': 'registration.backends.default.defaultbackend'}, name='registration_register'), ) however, can still create multiple accounts same email. problem? shouldn't django-registration using view specified? using django-registration 0.9b1. the version of django registration using has been re