Posts

Showing posts from July, 2015

Rails will not run this PostgreSQL migration, why? -

i have migration : def connection.execute(%q{ alter table enterprise_members alter column sso_id type string using cast(sso_id string) }) end where trying convert integer string. when run, returns : pg::undefinedobject: error: type "string" not exist : alter table enterprise_members alter column sso_id type string using cast(sso_id string) is because i'm trying cast it? how fix this? you can call string when using rails if choose go manual way, did in snippet, have stick in dbms' datatypes which brings point: try db-agnostic when can!

c# - jQuery / javascript download file doesn't work on Chrome -

i have jquery script in want download file located on server after user clicks on link. on ie11 works alright, make call to: window.open('file:///myserver0001/somefolder/tmp/toiletflush.log' i know security reasons, chrome doesn't allow use protocol file:/// . interesting because if write myself url on address bar show file, if make call window.open() opens me new empty window. also, removing file:/// , doesn't on chrome, says page not available so right don't know how make work on chromium. thought make workaround calling controller function through post/get , return fileresult , download file. works know simple way directly using jquery/javascript. any idea? try asp.net mvc fileresult: view: <a href='@url.action('getfile','home')">download file</a> in home controller: public fileresult getfile() { //read file content variable. string content=file.readalltext("filepath"); byte[] bytearray ...

c# - WPF RichTextBox RTF update text? -

i have wpf richtextbox which formatted rtf . have method dynamically adds hyperlinks. however when richtextbox text edited adding said hyperlink, rtf output incorrect because hyperlink appended end of complete rtf document. i have managed format richtextbox rtf text text solves text display in richtextbox hyperlink lost plain text. is there way of taking rtf richtextbox text , 're-loading' new flow document correct rtf output? i have method i'm passing in rtf string ( richtextbox.text ) gives me correct rtf rtf tags in richtextbox text... public void rebuildrtfforrichtextbox(string richtextboxtext) { flowdocument doc = new flowdocument(new paragraph(new run(richtextboxtext))); richtextboxarticlebody.document = doc; } as mentioned richtextbox has property named "document". getting property return flowdocument. if read this , can see flowdocuments made of blocks. can iterate on blocks of flow document...

vb.net - Closing an XML file after reading so it can be deleted -

i have problem deleting xml file after loading .xmldocument. my code parses xml file specific nodes , allocates values variables. once complete code processes data based on values xml file. this works fine until end when try delete xml file still open , error "the process cannot access file because being used process" guess xmldocument reader. here section of the xml processing code - works fine. `dim xmldoc xmldocument = new xmldocument() xmldoc.load(strfilename) intpassed = xmldoc.selectsinglenode("//calibrationpassed").innertext boolcheck = xmldoc.selectsinglenode("//checkscomplete").innertext intcertrequired = xmldoc.selectsinglenode("//schedule").innertext console.writeline("calibration passed: " & intpassed) console.writeline("checks complete:" & boolcheck) console.writeline("schedule: " & intcertrequired) strfirstname = xmldoc.selectsinglenode(...

jquery - Appium throws Error while tapping an visible drop-down item on Android Device/Emulator -

hello appium developers, i have issue while tapping visible drop-down item , please find below details replicate issue steps followed automate:- tap on drop-down image lists items. --- taping working fine here check drop-down items listed ---- required items listed , visible tap on required drop-down item --- org.openqa.selenium.webdriverexception: unknown server-side error occurred while processing command. (warning: server did not provide stacktrace information) command duration or timeout: 240 milliseconds note:- have tried click,flick etc events shows appium error. can share thoughts on ?? missing anything.... really appreciate inputs....... url :- http://jsfiddle.net/jqwidgets/pk7sp/ code snippet:- webelement element=driver.findelement(by.xpath("//td[contains(text(),'nancy davolio')]")); new touchactions(driver).singletap(element).perform(); appium logs:- debug: appium request...

ruby on rails - link_to object, how do I define the path? -

let's run command rails g scaffold movie title:string desc:text in generated index-file, /app/views/movies/index.html.erb , movie -objects looped this: <% @movies.each |movie| %> <tr> <td><%= movie.title %></td> <td><%= link_to 'show', movie %></td> # , other columns </tr> <% end %> i don't understand link_to 'show', movie part. in routing-file, movie-objects using resourceful routing ( resources :movies ), couldn't find out how works. tl;dr: if create link link_to "some place", theobject , lead , how can (re)define in routing? to explain, when use link_to "...", object , have remember ruby object-orientated, rails expects object have relevant data contained inside (if set correctly). objects so if you're defining @movies = movie.all , you're getting activerecord object containing collection of movie objects inside. lay...

merge - What does "use 'hg update' to get a consistent checkout" mean? -

i accidentally ran hg update featurebranch while working directory had changes. when asked me resolve merge conflicts on first file, pressed ctrl-c kill command. when try commit error: abort: last update interrupted (use 'hg update' consistent checkout) what mean , how recover situation? hg update -r . no-op update working branch without changing files , fix error message. i'm not entirely sure how/why works, if explains accept answer.

swing - Java JFreeChart: customize tooltip screen position -

i implemented own jfreechart xytooltipgenerator and, chart used on full screen, tooltip position (on screen) hides point related (e.g. in bottom right corner, since seems tooltip configured positioned south-east of mouse / data point). problem because user needs able click on chart's data points (as generates specific action). is there way either define dynamically position of tooltip (e.g. data points bottom right ask tooltip shown north-west) or, alternatively, define systematic position (e.g. north-west instead of south-east default)? this problem has given me headaches last few days - or hint more welcome. many thanks! thomas here's answer posted on jfreechart forum : jfreechart using standard swing tool tip mechanism. in chartpanel class, gettooltiptext(mouseevent) method overridden return appropriate text tooltip, , that's it. swing gives option override gettooltiplocation(mouseevent) method, , that's need here.

c# - How to make strings from Resources.resw show up in the designer? -

in shared project of universal app have 2 folders inside of strings folder, en-us , sv-se . inside of both folders have resources.resw files. these contain strings app. when run app i'm able see strings, mapped using x:uid , i'm not able see string when using designer designer. moving english resources.resw file root of strings generates error, telling me there no resources.resw file default language (en-us). also, not make strings appear in editor. is possible make resources *.resw appear in designer? i'd surprised if other project works think. strings in *.resw files not automatically understood designer. given this: <textblock x:uid="mywelcomemessage" /> in designer show empty textblock because designer doesn't localized resource @ design-time. recommendation use placeholder values items localizing resources.

sql - COUNT() doesn't work with GROUP BY? -

select count(*) table group column i total number of rows table, not number of rows after group by. why? because how group by works. returns 1 row each identified group of rows in source data. in case, give count each of groups. to want: select count(distinct column) table; edit: as slight note, if column can null , real equivalent is: select (count(distinct column) + max(case when column null 1 else 0 end) ) table;

python - Matplotlib absolute text positioning -

Image
i making movies matplotlib plots , have been struggling absolute positioning of text() elements. problem text blocks, typically increasing numbers, keep moving around depending on numbers printed. happens when set horizontal/vertical alignment fixed level (e.g. right or bottom ). this seems related use of latex fonts, in particular fonts characters wider others. default font (bitstream vera sans) not happen. here illustration of problem. default font: with latex cmbright font: notice how position of decimal point shifts horizontally depending if leading digit 0, 1, or 2. in other examples decimal point shifts vertically. following code used produce these plots: figure(figsize=(4,4)) tt = text(.7, .5, '00.0', va='center', ha='right', fontsize=60) in range(26): tt.set_text('%04.1f' % (float(i))) savefig(...) for latex font loaded following before: rc('text', usetex=true) rc('text.latex', preamble=r'\usepa...

php - pass variable from controller to template laravel -

admincontroller.php <?php class admincontroller extends basecontroller { protected $layout = 'layouts.admin'; /** * show profile given user. */ public function register() { $this->layout->title = 'admin title'; $this->layout->menu_active = 'register'; $this->layout->content = view::make('pages.admin.register'); } } layout/admin.blade.php <!doctype html> <html> <head> @include('includes.head') </head> <body> <div class="container"> <header class="row"> @include('includes.header') </header> <div id="main" class="row"> @yield('content') </div> <footer class="row"> @include('includes.footer') </footer> </div> </body> </html> includes/head....

php - How to properly render the same thing as drop down-list, but in selectbox? -

there's array looks so: array ( [items] => array ( [1] => array ( [id] => 1 [parent_id] => 0 [name] => ) [3] => array ( [id] => 3 [parent_id] => 1 [name] => person 2 ) [2] => array ( [id] => 2 [parent_id] => 1 [name] => person 1 ) [5] => array ( [id] => 5 [parent_id] => 1 [name] => gallery ) [4] => array ( [id] => 4 [parent_id] => 1 [name] => cv ) [6] => array ...

tomcat - Jenkins does not redirect to HTTPS -

Image
the problem i using jenkins on https/ssl (the details of setup below). can navigate https://jenkins.mydomain.com:8088 without problems. links correct https:// in front of them. can navigate through jenkins pages. except when jenkins tries redirect (e.g after login, after clicking build , etc). whenever jenkins tries redirect page, sends me http:// page (not https:// ) what i've tried i have tried setting setting jenkins url in global configuration. works fine everything, except redirects http:// , despite url saying https:// i have tried following instructions here regarding modifying jenkins.xml port configuration, setup not using jenkins windows service install, don't have jenkins.xml there different place can specify parameters jenkins? i have tried understanding whatever "mod_proxy https" means, don't have virtual hosts configuration. , besides, tomcat installation not 1 handles ssl. issue seems in jenkins's redirect mechanism, i...

excel - Count what is in a row based on specific criteria -

i have large table of data names in first column , data applies names going out right varying ranges (see example below). on sheet have space type in users name. each column of data below represents week's worth (this varies new users added). basically want type in users name on sheet b , have formula goes sheet a, finds user, , counts out how many cells in row contain data can find how many weeks of data have on user (this used in trending formulas can work). sheet user data1 data2 data3 roger 1 .16 10 sam 4 beth 3 sheet b roger has "3" week(s) worth of data any ideas on how formula? or need apply vba cell want counts returned? i hope makes sense , thank you! try this =counta(offset('sheet a'!1:1,match(a1,'sheet a'!a:a,0)-1,0))-1 on sheet 2, a1 contains name up

c - Displaying picture on microcontroller's screen -

Image
hi trying let picture (that has size of: 40 x 42) take more space that’s available on microcontroller, because can see face pretty small on screen: the first thing had tried, use bigger picture size of 70 x 73. puts picture in same place in no room left fit in: the problem need create more space/room, because want put bigger picture of myself on screen. don’t know how can fix can please me, please? this code use display tiny picture (40 x 42) on microcontroller: showcredits() { while (1) { // 38 width, 44 height //int asciizaky [44] [38] // int asciizaky [42] [20] = { //40 x 42 size // int asciizaky [73] [35] = { //70 x 73 size int asciizaky [44] [38] = { //40 x 42 size {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, {1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,...

Unable to get the subscription working with google-mirror-api -

i'm using sample java app. send myself card has "reply" action. reply glass using voice, don't notification. have refresh page see reply. i've setup reverse proxy 'grok' notifications. on starting app, see in logs: info: attempting subscribe verify_token 68840674215 callback https://mirrornotifications.appspot.com/forward?url=http://xyz.ngrok.com/notify if make post request rest client notify-url , notifyservlet.dopost() correctly invoked. in insertsubscription(credential credential, string callbackurl, string userid, string collection) method of mirrorclient, have hardcoded callbackurl = " https://mirrornotifications.appspot.com/forward?url=http://xyz.ngrok.com/notify "; on google api console, have added uris "javascript origins" , "redirect uris" can please tell me missing here? with ngrok proxy, use https ://xyz.ngrok.com/notify callback url instead of having mirrornotifications.appspot.com forward ...

autoit - how to submit the 3rd form on the current webpage -

i had edit question because felt not describing correctly i trying submit form on current webpage. problem form trying submit coming 2 previous submit forms. cant call url using $oforms = _ieformgetcollection ($oie) because original url of $oie has changed. i use on first form submit code works fine, once next page have new url , need submit form well. how can call current page , 3rd form on page , submit that? $oforms = _ieformgetcollection ($oie) $oform in $oforms _ieformsubmit($oform) next because page changing, original form collection becomes invalid when new page loaded. need new form collection each time. the code have more like: local $aformclassnames[3] = ["formclassnameonpage1", "formclass2", "etcetc"] $i = 1 3 $oform = _ieformgetobjbyname($oie, $aformclassnames[$i]) switch $i case 1 ; fill out form 1 case 2 ; fill out form 2 case 3 ; fill out form 3 ...

netsuite - Using libraries in suitescripts -

so have simple chart made using chart.js , using following code: <html lang="en"> <head> <meta charset="utf-8" /> <title>chart.js demo</title> <script src='chart.min.js'></script> </head> <body> <canvas id="buyers" width="600" height="400"></canvas> <script> var buyerdata = { labels : ["january","february","march","april","may","june"], datasets : [ { fillcolor : "rgba(172,194,132,0.4)", strokecolor : "#acc26d", pointcolor : "#fff", pointstrokecolor : "#9db86d", data : [203,156,99,251,305,247] } ] } var buyers = document.getelementbyid('buyers').getcontext('2d'); new chart(buyers).line(buyerdata);...

php - jQuery Validate MultIple File Upload -

i trying validate html file upload using jquery validate plugin, my html form is, <form id="formid" action="welcome/test_up" method="post" enctype="multipart/form-data"> <input type="file" name="myfile[]" id="myfile" multiple> <input type="submit" name="submit" id="submit" value="submit"/> and i'm using jquery validation plugin as, $('#formid').validate({ rules: { inputimage: { required: true, accept: "png|jpe?g|gif" } }, messages: { inputimage: "file must jpg, gif or png" } }); but unfortunately it's not working, it's working if use name="myfile" not when use name="myfile[]" any idea solve ? try set rule in input tag become <input type="file" name="myfile[]" id="myfile" accept="png|jpe?g|gif" multiple> ...

jquery - Wordpress anchor menu active or inactive -

i have issue here. working on wordpress-driven site ( http://www.everaccountable.com/ ). can me on menu? the menu uses custom menu , links there anchored , on home page. i set menus inactive (not highlighted) , make them active (highlighted) when scrolled or selected. just this: http://www.maddim.com/demos/spark-r9/ thanks. http://www.maddim.com/demos/spark-r9/ 1 page site. site not 1 page. must right code in 1 page. can use http://getbootstrap.com/javascript/#scrollspy

python - 'pip' is not recognized as an internal or external command -

i'm running weird error trying install django on computer. this sequence i've typed command line: c:\python34>python get-pip.py requirement up-to-date: pip in c:\python34\lib\site-packages cleaning up... c:\python34>pip install django 'pip' not recognized internal or external command, operable program or batch file. c:\python34>lib\site-packages\pip install django 'lib\site-packages\pip' not recognized internal or external command, operable program or batch file. what causing this? edit ___________________ as requested when type in echo %path% c:\python34>echo %path% c:\program files\imagemagick-6.8.8-q16;c:\program files (x86)\intel\icls client\ ;c:\program files\intel\icls client\;c:\windows\system32;c:\windows;c:\windows\s ystem32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files (x86)\ windows live\shared;c:\program files (x86)\intel\opencl sdk\2.0\bin\x86;c:\progr files (x86)\intel\opencl sdk\2.0\bin\x64;c:\pro...

javascript - How can I log a message on every Marionette view render? -

i have marionette application large number of views. want log debug message console when each rendered (and possibly, in future, on other events) i doing logging each view's onrender method: mymodule.myviewtype = marionette.itemview.extend({ // ... view properties , methods onrender: function() { // ... other onrender code console.debug('mymodule.myviewtype %s %s', this.cid, 'render'); } }); this works, has several disadvantages: the logging code must added manually each view. several views don't have custom onrender actions i'm adding methods purpose of debugging only. feels wrong. if want alter or remove logging methods (e.g. go production), need alter lot of code. if want add code event, e.g. show , need add event handler or new method every view. is there way log every view render without adding code each view? yes. can decorate backbone.view.constructor hook view creation lifecycle. can register c...

sql server - SQL Query Add to total sum if.. else dont add -

Image
how achieve result ? need calculate total cost of product when product made of components. new me, should add 100$ total cost if customer chooses service called delivery. this have tried far. select sum(component.cost*productcomponent.quantity) totcost productcomponent left join component on productcomponent.componentid = component.componentid i guess me total cost of product. now there table service has many many relationship order. order has many many relationship service. need need add 100$ in total cost if there 'deliverly' used in service. i have attached er diagram of database structure. hope question clear. the basic idea you'd have put case statement in there add $100 if there record in service table given order. below query should of way there, looking @ cardinality of relationships may need group results or use subqueries chop down 1 row. select case when sa.serviceid not null sum(component.cost*productcomponent.quantity) + 100 ...

android - Fragment Communication - selecting tabs and running methods in other tabs (Fragments) -

i have implemented tabbed action bar using android fragments (not support package). have button on 1 of tabs when pressed calls method in parent activity using interface. the method in parent activity function change selected tab (fragment) , call method in tab. i have interface allows 1 of fragments call method in parent activity @override public void onchangetabbuttonselected(string billingid) { int position = 1; // selects 2nd tab getactionbar().setselectednavigationitem(position); ((fragmenttabsearchclients) searchclientstab).getclients(billingid); } this works fine , tab changed , method called appears fragment lifecycle has not been initiated correctly has method called getclients uses `getview()' returns null. in parent class there way initialise tab before calling method on tab?

namespaces - Namespacing Variables - javascript -

i see lot of namespacing examples functions but, o.k. declare variables (global program) in way? var mynamespace = {}; mynamespace.var1 = 5; or should variables placed in functions within namespace? you should avoid global variables... use sort of module pattern instead, e.g. (function () { "use strict"; var myvar = 'blob'; }()); see http://yuiblog.com/blog/2007/06/12/module-pattern/ edit: more clarification: var ns1 = ns1 || {}; ns1.mymodule = function () { "use strict"; var myvar = 'blob'; return { mypublicmethod: function () { return myvar; } }; }();

Deserialize JSON C# -

i having problem deserializing json object because not consist of array. a sample of json string : { "data": { "a1": { "name": "", "code": "", "type": "" }, "a2": { "name": "", "code": "", "type": "" }, "a3": { "name": "", "code": "", "type": "" } } } and here code, json string read file, , cannot changed. var json = "{\"data\":{\"a1\":{\"name\":\"\",\"code\":\"\",\"type\":\"\"},\"a2\":{\"name\":\"\",\"code\":\"\",\"type\":\"\"},\"a3\":{\"name\":\"\",\"code\":\"\...

java - itext - Fastest way to extract text from pdf -

i'm trying extract text pdf files in android, 30 pages long, using examples post: searching words in pdf , extracting using itext in android my problem takes long extract text, 10 seconds wondering if there faster method extracting text. i need search inside pdf, , didn't find way this, without extracting text first.

javascript - Transform images into a circular variant, changing circle size and place -

i love circular profile pictures, hate cant edit them. example dont want circle in middle , standard size, want smaller or something. explanation pictures: the 4 images, bottom top: input, image editor, moving circle, output now, want put normal image in , there black overlay kind of opacity. in middle you'll have transparent circle can select part want in circle. can press save , there .png file made. i thinking of doing jquery watermarks, couldn't figure out. got idea? there couple of methods: you can use css2/3 - corner-radius (for newer browsers) or overlay image, image can cropped, , background can scaled/moved via css background-position , background-size accordingly. save image, you'll need minimalistic php script do same operation server-side (given parameters) , output image user. you can use html5 canvas - specification involves handy clip method (which straightforward - limits drawn imagery current path), , can obtain image data via t...

xml - Retrieve image in RSS feed description with jQuery -

<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> <channel> <description/> <title>example</title> <link>http://example.com/</link> <item> <title> post title </title> <description> <div class="thumbnail"><a href="#"><img src="https://i.imgur.com/192384.jpg"/> </a></div> <p class="intro"><span> lorem ipsum dolor sit amet, consectetur adipiscing elit.</span> <!-- more --> <span> duis end </h3> <img src="http://i.imgur.com/wq8fu.png"/><div class="credit"> clas henrik </div> </span></p> </description> </item> </channel> </rss> how retrieve first image in rss <description> , 1 wr...

vb.net - mousedoubleclick doesnt work for dynamically created button -

in button events mousedoubleclick included when add form when programmatically add buttons form mousedoubleclick doesn't exist in ide suggestion events if write myself program execute without error doesn't on mousedoubleclick event here code: dim pb new button pb.text = "hello" pb.size = new size(150, 110) frmaddimage.flpanel.controls.add(pb) addhandler pb.mousedoubleclick, addressof pbbutton_mousedoubleclick private sub pbbutton_mousedoubleclick(byval sender object, byval e system.windows.forms.mouseeventargs) 'do end sub what boils down following: buttons don't use double-click event. button class inherits control provides double-click event. there it's not fired class. you can use .clicks property of mouseeventargs variable in mousedown event though: private sub button3_click(sender object, e eventargs) handles button3.click dim pb new button pb.text = "hello" pb.size = new size(150, 110) frmaddim...

javascript - Get an INPUT value from HTML Input -

i trying make guessing game. below repo on github. https://github.com/christsapphire/guessing-game i wrote logic in guessing-game.js , worked fine. using userguess = prompt("guess number"). however, if click cancel on prompt, keep asking (maybe thats why??). i tried translate jquery, using userguess = $('#input').val(); , encountered bug. webpage crashed after click "submit" button. i want when user click "submit" button on webpage, runs function below. function checkuserinput() { (var valid = false; !valid;) { //i suspect these 2 below // userguess = parseint($('#submit').val(), 10) //userguess = parseint(prompt("guess number"), 10); //----------- if ((userguess >= 1) && (userguess <= 100)) { if (repeatanswer(userguess, userguesshistory)) { $('#status').text("you chose number before! choose number!"); ...

mandrill - PHP API send email does nothing via Mandril -

i sending message based on php example in docs. looking through others suggestions have altered sending part follows .. $async = false; $ip_pool = null; $send_at = null; $result = $mandrill->messages->send($message, $async, $ip_pool, $send_at); print_r($result); i valid result ... array ( [0] => array ( [email] => valid-email@gmail.com [status] => queued [_id] => 845a02f92f03487f95ff9bc5b5e33497 ) ) when check api logs says message sent if try .. $result = $mandrill->messages->info($id); with correct id result of no message found. i can send email using mandril test page

javascript - Sticky.js appears to not work -

i trying sticky.js work on web page... on navbar - , unfortunately not work! have tried 2 different plugins, neither seem work! for not know, thought behind plugin it's supposed make html element 'stuck' screen once scroll down... i've been inspired codeanywhere.com navigation menu, , want similar! would mind taking @ website page , troubleshooting why my current (same sticky.js link above) sticky plugin not work? i absolutely novice when comes javascript. appreciated. try below code... changes: 1) included jquery cdn in head section 2) included revised style in head (alter per requirements) 3) revised javascript @ end. <!doctype html> <html> <head> <title>home &#126; pixel crescent</title> <base href="http://pixelcrescent.com/" /> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0" name="viewport"> ...

osx - increase size of stack in nasm OS X intel 64 -

how can increase size of stack in assembly (nasm os x intel64) i used .stack 4096 before section .data return error error: attempt define local label before non-local labels error: parser: instruction expected please guide me. you can modify stack size linker - ld osx: https://developer.apple.com/library/mac/qa/qa1419/_index.html the default stack size on osx 8 megabytes, not large enough you?

c - finding memory access violation for a code -

i noob on valgrind. gcc compiler compiler gave me go flag online compiler gave me hard time need submit code. please me finding memory access violation below code #include<stdio.h> #include<string.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include"railfence.h" #define rail 2 char* getcipher(char plaintext[]) { int strln; int i; int j; int k = 0; char *result; char **arr; strln = strlen(plaintext); if (strln == 0 || strln > 20) return "-1"; ( i=0 ; < strln ; i++) if (!isupper(plaintext[i])) return "-1"; arr = (char **) malloc ( rail*sizeof(char) ); ( i=0 ; < rail ; i++) arr[i] = (char *) malloc ( strln*sizeof(char) ); k = 0; ( = 0 ; < strln ; i++ ) ( j = 0 ; j < 2 ; j++ ) { if ( (i+j)&1 ) arr[j][i] = '.'; else arr[j][i] ...

html5 - CSS multi level menu with nested list -

Image
i want make pure css multi level menu picture above. have tried tutorial not working me. menu "xxxxx" , "yyyyy" appear below menu "bbbbb" css code below. what want make 3 level menu picture above. this html menu: <span id="nav"> <ul> <li><a href="#">ssss</a> <ul> <li><a href="#">aaaaa</a></li> <li><a href="#">bbbbb</a> <ul> <li>xxxxx</li> <li>yyyyy</li> </ul> </li> </ul> </li> <li><a href="#">ttttt</a></li> <li><a href="#">uuuuu</a></li> </ul> ...

spring - Problems with @InitBinder -

i have problem initbinder use in form, allowed how below ? @initbinder public void initbinder(webdatabinder binder, webrequest request) { binder.registercustomeditor(class.class, "subclass", new propertyeditorsupport() { @override public void setastext(string text) { setvalue((text.equals("")) ? null : classdao .getclass(integer.parseint((string) text))); } }); binder.registercustomeditor(teacher.class, "teacher", new propertyeditorsupport() { @override public void setastext(string text) { setvalue((text.equals("")) ? null : teacherdao .getteacher(integer.parseint((string) text))); } }); } if choose 1 example teacher works...

Android performFiltering in AutocompleteTextView filters null when below threshold -

the setup: i have autocompletetextview custom arrayadapter , filter bound it. i have set autocomplete threshold 3 xml using completionthreshold attribute. the funny thing that, every time constraint length less threshold value , android calls performfiltering method null constraint . this indeed implemented in autocompletetextview (line 789): http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.2_r1/android/widget/autocompletetextview.java#783 can give explanation on such behaviour?

Git pushing local branch to remote branch -

i have 2 remote branches: master stable the master branch aligned release; production ready code stays here. stable branch used testing. our hudson builder rebuilds code on each push, send built product test team. i use local branches dependent stable branch given job. i need push commit stable branch build product, after tests passed, how can merge local branch - parent stable branch - master? after finish development on stable branch should merge master go command line: git checkout master checkout master branch. git pull make sure have latest code. git merge stable when editor pops up(if vi hit :q) quit. git push -u origin master push merged master origin master. thats have latest code on master.

powershell - Can I pass Parameter using Get-SPWeb andgetting list -

i'm using next code list of data sharepoint , export text file can pass parameter data date date : select * between $myweb = get-spweb "http://ilike-eg.suz.itcgr.net/sm" $mylist = $myweb.lists["scgc"] $exportlist = @() $mylist.items | foreach-object { $obj = new-object psobject -property @{ "a"=" "+$_["aaccount_id"] "b"=" "+$_["btransaction_id"] "c"=" "+$_["cdate"] "d"=" "+$_["dcustomer_id"] "e"=" "+$_["ecustomer_name"] "f"=" "+$_["famount"] "g"=$_["gclass"] } #remove unnecessary sort $exportlist += $obj $datestamp = get-date -uformat "%y-%m-%d@%h-%m-%s" $nameonly = "cdp" #exporting sorted properties $exportlist | select-object a,b,c,d,e,f,g | expo...

angularjs - Why does ng-click not work in case-1, but does in case-3? -

there fundamental im not yet understanding. im trying make user of modal module in angular ui.bootstrap im finding clicks not activating open() function -- boiling down simple testcase, below, im not seeing calls when ng-click points function (alert or console.log), work when ng-click points expression why alert not called in first example? <div data-ng-app> <button data-ng-click="alert('message 1');"> ngclick -- not working, why not? </button> <button onclick="alert('message 2');"> plain onclick </button> <button data-ng-click="count = (count + 1)"> works, why ??? </button> count: {{count}} </div> http://jsfiddle.net/h2wft/1/ ng-click meant use either function in current scope (so example $scope.alert = window.alert solve problem of not being able alert there) or angular expression. looks angular not allow use glob...

php - How do I show only one specific post with comments and author box on the homepage in Wordpress? -

i want show full post comments , author box on home page if actual link post clicked. set canonical on actual post point home page seo purposes. i've seen code out there, far nothing matches exact needs. i want display 1 wordpress post on homepage comments , author box below post. , want able specify post 1 gets displayed on homepage. (which post id#) to add this, need rel="author" visible in header section. i'm using wordpress seo yoast , have selected not show rel="author" pages. , code out there i've tried shows single post on home page treats if page instead of post, therefore removing rel="author" head area. please not reply how set number of posts in reading tab or how set static page. know that. won't work needs. in summary, when go home page see article wrote along comments , author box below , rel="author" in header. your best bet set homepage static page, , build custom template page. in editor, cr...

javascript - jQuery AJAX: why is .error() method deprecated in favor of .fail()? -

if read link here .ajax() say: jqxhr.fail(function( jqxhr, textstatus, errorthrown ) {}); alternative construct error callback option, .fail() method replaces deprecated .error() method. refer deferred.fail() implementation details. why .error() method deprecated in favor of .fail() ? the 2 options equivalent. however, promise-style interface (.fail() , .done()) allow separate code creating request code handling response. you can write function sends ajax request , returns jqxhr object, , call function elsewhere , add handler. when combined .pipe() function, promise-style interface can reduce nesting when making multiple ajax calls: $.ajax(...) .pipe(function() { return $.ajax(...); }) .pipe(function() { return $.ajax(...); }) .pipe(function() { return $.ajax(...); });

c# - Save a related entry 'on-the-fly' if it does not already exist -

this seems simple, yet can't head around how should it. keep list of 'position' names of employees. so, when entering employee, should able choose either list of positions, or enter new one. in end should of course store id of position in position table. tables this public class position { public int id {get; set;} public string name {get;set;} } public class employee { public int id {get; set;} public string lastname {get;set;} : : public int positionid {get;set} } i think having type-ahead function looks existing entries type, , in case no match found, post new position position table , somehow newly created id hereof , store in employee record. done - specifically, there way return key of newly created record? hmm, might have explained myself solution - general way of doing it? thanks :) i agree user1987322 may not best solution, in case: if using entity framework associate 1 entity related entity. model this: usin...

css - How to add additional classes to django form field -

i've learned about: form.error_css_class form.required_css_class docs: https://docs.djangoproject.com/en/dev/ref/forms/api/#django.forms.form.error_css_class so defining 'error_css_class' , 'required_css_class' in forms class myform(forms.form): error_css_class = 'error' required_css_class = 'required' name = forms.charfield(...) i can do: <div class="field-wrapper {{ form.name.css_classes }}"> ... </div> this output: <div class="field-wrapper required"> ... </div> however want add additional classes field, e.g add 'text name' css class "name" field. , reading docs, think possible. https://docs.djangoproject.com/en/dev/ref/forms/api/#django.forms.boundfield.css_classes after reading above tried do self.fields['name'].css_classes('name text') that doesn't work. get 'charfield' object has no attribute 'css_classes...