Posts

Showing posts from January, 2010

javascript - sharepoint content query webpart: hide empty column with jquery -

i want hide list column in editform.aspx </script> <script language="javascript"> $(document).ready(function() { $('nobr:contains("columnname")').closest('tr').hide() }); </script> it works. want hide it, if there no value. how this? $(document).ready(function() { if ($('nobr:contains("columnname")').val() == "") { $('nobr:contains("columnname")').closest('tr').hide() } });

How to get a route value in the view (Asp.net Mvc) -

is there alternative route value in view page instead of read querystring ? @html.actionlink("language resources", "index", "languageresource", new { languagecode = request.querystring["languagecode"] , "") don't rule out keeping simple: public actionresult action(int id) { return view( id); } indicate type of model we're dealing with @model int and refer value in typed way via: @model

c# - Transform Web.config Hibernate configuration VS 2012 -

i have web.config: <?xml version="1.0"?> <configuration> <configsections> <section name="hibernate-configuration" type="nhibernate.cfg.configurationsectionhandler, nhibernate" requirepermission="false"/> </configsections> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.driver_class">nhibernate.driver.oracleclientdriver</property> <property name="connection.connection_string">{old_connection}</property> <property name="dialect">nhibernate.dialect.oracle10gdialect</property> <property name="proxyfactory.factory_class">nhibernate.bytecode.defaultproxyfactoryfactory, nhibernate</property> <property name="show_sql">false</property> <property name="query.substitutions...

jquery - how parameter inside function works? -

html <p>this <b>bold</b> paragraph.</p> <button>add</button> jquery $("button").click(function(){ $("p").text(function(i,origtext){ return "old text: " + origtext + " new text: hello world! (index: " + + ")"; }); }); i know origtext not called outside function returning value. how? demo as docs says function(index, text) a function returning text content set. receives index position of element in set , old text value arguments. and how jquery’s .text() work, internally?

version control - New SDK drop... how to instruct git that certain files are moved? -

i've been working on sdk i've received new code drop for. when starting on project created import branch on committed sdk , merged master branch first commit. but there's new version of sdk , noticed lot has changed in directory structure. quite lot files have been moved subdirectories improve structuring of codebase guess. so want have new commit on import branch merging master easier don't know how instruct git files have been moved. git mv file_a dir_a/file_a ...doesn't work because target file exists. tried: git mv -f file_a dir_a/file_a isn't want either since target location overwritten content of old version. i tried gitmoving first resemble new directory structure , copying over. git still sees remove of old file , addition of new file. so way proceed here? tips/pointers welcome! git not track moves can't directly. git tries identify moved files on fly looking see if file added lot file deleted. git rm old files ,...

extjs - extjs4 CheckboxModel select all -

Image
i want checkboxmodel appear checked when grid rendered: this code: sm = ext.create('ext.selection.checkboxmodel', { listeners: { selectionchange: function (sm, selections) { // must refresh view after every selection sm.view.refresh(); } } }) the grid: { xtype: 'gridpanel', title: 'gridtitle', selmodel: sm, store: my_store, columns: { items:[ .. ] } } you use afterrender listeners of grid select rows : listeners:{ afterrender:function( thisobj, eopts ){ var sm=thisobj.getselectionmodel(); sm.selectall(true); } },

sql server 2008 - SQL query select row when match is made, select other row when match is not made -

i have 2 tables: attribuut attribuutvalue they have one-to-many relationship. attribuut can have multiple attribuutvalues. these attribuutvalues contain states. now want query gives me latest attribuutvalue attribuut, has: state 3 or state 6 . then hit problem: when attribuut contains attribuutvalue state 4 , latest attribuutvalue state 3 should shown. select distinct * attribuut att left join attribuutvalue value on (value.attribuuthead = att.displayid) value.status = 3 or (value.status = 6 , not exists (select * attribuutvalue value2 value2.valueid = value.valueid , value2.status = 4)) order valueid desc however gives me not resultset want. there still attribuutvalues state 4 shown. , doesnt give me last record in list... first problem have in not exists sub-query. should have joined on attribuuthead , not valueid (which presume unique key on table) second missing mechanism filter 1 value per attribuuthead . row_number() can achieve t...

android - AutoCompleteTextview not functioning -

i trying set autocompletetextview in activity. no errors. on preview screen looks this( http://gyazo.com/7bf15e2b0b37f09d0d20ba883de49dce ). however, when run app on phone or on emulator, looks this( http://gyazo.com/bf5d6cb733c03835a1061fd175c500a0 ) , no suggestions come have listed when type them in. here's code, can me out here: search screen xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/search_screen_medium" android:orientation="vertical" > <autocompletetextview android:completionthreshold="1" android:id="@+id/autocomplete" android:layout_width="250dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginleft="10dp" android:hint="@string/s...

mysql - Converted PHP-Code to (My)SQL stored procedure -

Image
i've converted following php code mysql stored procedure. there no obvious syntax error execute phpmyadmin. can see with select routine_definition information_schema.routines routine_schema = 'chess'; as first time i've written stored procedure, know does stored procedure think does? (see flowchart in "what should do") is stored procedure plain sql (to standard) or able use mysql databases? mysql specific? rid of that? is there way can improve stored procedure? there best practices broke? do have sanitize input data when use stored procedures? here short overview on database , all code . hope not necessary answer questions. what should do new stored procedure delimiter // create procedure challengeuser( in challengeduserid int, in currentuserid int, out startedgameplayerusername varchar(255), out startedgameid int, out incorrectid bit, out alreadychallengedplayer bit, out alreadychallengedgameid int ) begin ...

exception - UnsatisfiedLinkError on Raspberry Pi with UsbScope HS4 -

im working on "usbscopenode" on raspberry pi - raspberry pi gathers data plugged in usb scope. usb scope hs4 tiepie : i programmed first steps on windows pc , made point able data , settings , everything. decided switch arm library. seem have problems jna on raspberry pi. small program crashes when trying load library. code load library looks follows: libtiepiehs4library instance = (libtiepiehs4library) native.loadlibrary((platform.isarm()? "libtiepie" : "c"), libtiepiehs4library.class); its same used version under windows in case libtiepie ".so" file , not dll. im getting following error message code: exception in thread "main" java.lang.unsatisfiedlinkerror: /tmp/jna-3577/jna3799405475131998919.tmp: /tmp/jna-3577/jna3799405475131998919.tmp: cannot open shared object file: no such file or directory @ java.lang.classloader$nativelibrary.load(native method) @ java.lang.classloader.loadlibrary1(classloader.java:1939)...

java - unsubscribe previous requests before subscribing -

Image
in application, have field "last accessed time" in header gets updated every 5 seconds. have included header.jsp in other jsps. [link1.jsp , link2.jsp.refer screen shot.] now, on load fire request server , request gets suspended. // refer attached .js file , .java file works fine. response server every 5 seconds. now, when navigate other jsps clicking link, page gets reloaded i.e., header.jsp gets reloaded. now, response server instead of every 5 seconds, response requests initiated during initial page load. so, appears although field gets updated every 2 seconds instead of actual interval of 5 seconds. when keep navigating , forth clicking links, clock ticks continuously coz, there requests got fired during various intervals. is there way avoid this? i intend cancel previous requests when load header.jsp again. tried unsubscribe() in conjunction long-polling. didn't work. also, tried invoking "/stop" url per link , on it's callback thought firing...

regex - Spiting Regular expression and accessing Array of Array -

an example trying understand website. people2.txt follows. 2323:doe john california 827:doe jane texas 982982:neuman alfred nebraska i don't output shown command below . *ps c:\ get-content people2.txt | %{$data = [regex]::split($_, '\t|:'); write-output "$($data[2]) $($data[1]), $($data[3])"} john doe, california jane doe, texas alfred neuman, nebraska* i take out numbers , swapping first , second using gc c:\appl\ppl.txt | %{$data = [regex]::split($_, ":") ;write-output $data[1] } | out-file c:\appl\ppll.txt gc c:\appl\ppll.txt | %{$data = $_.split(" "); write-output "$($data[1]) $($data[0]), $($data[2])"} please help **need find more efficient ways this. also want understand '\t|:' - 'split @ first tab stop , : ' ?** just threw off top of head: ^(?<number>\d+):(?<first>\w+)\s+(?<last>\w+)\s(?<location>.*)$

asp.net mvc - take value of bool and display as checkbox -

each record in 'supplier' table has has bool 'supplieremailprovided' column. display value on screen: @model.suppliers.where(s => s.id == products.preferredsupplierid).firstordefault().supplieremailprovided this works fine, atm displays 'true' or 'false' (on screen) depending on value. i want change checkbox, disabled if value false tried like: @html.checkboxfor(s => s.suppliers.where(x => x.supplieremailprovided)).firstordefault().supplieremailprovided' but not good. ideas guys? edit have given suggestions ago. @if((s => s.id == products.preferredsupplierid).firstordefault().supplieremailprovided) { @html.checkboxfor(s => s.suppliers .where(x => x.id == products.preferredsupplierid) .firstordefault() .supplie...

iso - SDWebImage : UIImageView to adjust size by the size of downloaded images -

i try download image custom tableviewcell problem these images varied width , height. how create uiimageview can adjust width , height per image downloaded ? i using sdwebimage framework caching , download. , put setimagewithurl code in cellforrowatindexpath. thanks in advance go line 113 of sdwebimagedecoder.m, replace bitmapinfo value kcgimagealphanoneskiplast kcgimagealphapremultipliedfirst , voilà!

ios - Cannot find executable GMSCoreResources.bundle -

after upgrading google maps sdk 1.4 i'm receiving following error: cannot find executable cfbundle 0x175e52e0 /var/mobile/applications/-/-.app/googlemaps.bundle/gmscoreresources.bundle> (not loaded) when migrating replaced both bundle , framework, , looks (gmscoreresouces.bundle inside googlemaps.bundle). any ideas? try doing clean , rebuild. if doesn't delete bundle , resource project , re add them.

show and hide is not happening properly in html through jquery -

i did .toggle() functionality in jquery on content. when click on read more button text link disappears , first paragraph becomes invisible. here jquery code $(document).ready(function(){ $('article p').hide(); $('article p').eq(0).show(); $('p.read-more').show(); $('p.read-more').click(function(){ $('article p').show('slow'); $('article').css('background', '#f5f5f5').show('slow'); $(this).text('read less'); return false; }); }) html code <article class="content"> <p>dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 </p> <p>dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text 1 dummy text...

sql server - t-SQL Aggregate Logic -

lets have table id , bit column. execute query returns number of rows (for example id>5). want have , aggregate operation across results of bit column. have figured out workaround, it's not pretty: select case when count(id) = sum(cast(istrue int)) 1 else 0 end aretrue table id > 5 what i'm doing here, since there no aggregate function multiply results, practically comparing total number of records sum of integer representation of bit column. if they're equal, there no 'falses', works , operation between them. an or max column, pretty straightforward. the problem particularly ugly , should killed fire. there elegant, proper, way this? you achieve using variable store calculation, example: declare @result bit = 1 select @result = @result & istrue table id > 5

caching - silverstripe static publisher - pages affected by DataObject Changes -

is there possibility trigger update of cache if dataobject edited? example updating news dataobject should update cache of pages, displaying these newsobjects. many thanx, florian here using staticpublishqueue module. in newsdataobject.php: function onafterwrite() { parent::onafterwrite(); $url = array(); $pages = $this->pages(); //has_many link pages include dataobject foreach($pages $page) { $pagesaffected = $page->pagesaffected(); if ($pagesaffected && count($pagesaffected) > 0) { $urls = array_merge((array)$urls, (array)$pagesaffected); } } urlarrayobject::add_urls($urls); } this takes each of pages references dataobject, asks it's url , url of related pages (e.g. virtual pages reference page), compiles urls big array, adds array static publishing queue. queue gradually process until affected pages republished. the event system allows add layer of abstraction between republishing...

hadoop - Sqoop creating insert statements containing multiple records -

we trying load data sqoop netezza. , facing following issue. java.io.ioexception: org.netezza.error.nzsqlexception: error: example input dataset shown below: 1,2,3 1,3,4 sqoop command shown below: sqoop export --table <tablename> --export-dir <path> --input-fields-terminated-by '\t' --input-lines-terminated-by '\n' --connect 'jdbc:netezza://<host>/<db>' --driver org.netezza.driver --username <username> --password <passwrd> the sqoop creating insert statement in following way: insert (c1,c2,c3) values (1,2,3),(1,3,4). we able load 1 record when try load data multiple records, error said above. your highly appreciated. making sqoop.export.records.per.statement=1 make export process extremely slow if export record count large "5 million". to solve need add following things: 1.) properties file sqoop.properties , must contain property jdbc.transaction.isolation=transaction_read_unc...

linux - Receiving multiple datagrams in a single system call -

on linux, unless i'm mistaken, application can use socket call family send or receive 1 packet @ time on datagram transports. would know if linux provides means application send , receive multiple packets in single call on datagram transports. use recvmmsg receive multiple datagram packets (example udp) int recvmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec *timeout); description recvmmsg() system call extension of recvmsg(2) allows caller receive multiple messages socket using single system call. ... http://man7.org/linux/man-pages/man2/recvmmsg.2.html use sendmmsg send... int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags); description sendmmsg() system call extension of sendmsg(2) allows caller transmit multiple messages on socket using single system call. http://man7.org/linux/man-pages/man2/send...

android - Image could not be loaded on twitter -

i'm trying share image through twitter worked fine facebook twitter image not loaded! dont know why here code: enter code here public void share(string nameapp) { try { list<intent> targetedshareintents = new arraylist<intent>(); intent share = new intent(android.content.intent.action_send); share.settype("image/jpg"); list<resolveinfo> resinfo = getpackagemanager().queryintentactivities(share, 0); if (!resinfo.isempty()) { (resolveinfo info : resinfo) { intent targetedshare = new intent(android.content.intent.action_send); targetedshare.settype("image/jpg"); // put here mime type if (info.activityinfo.packagename.tolowercase().contains(nameapp) || info.activityinfo.name.tolowercase().contains(nameapp)) { targetedshare.putextra(intent.extra_subject, "sample photo"); ...

java - Split line with with several spaces -

i have text file in have take line line. for each line have cut string , put in table. my separator space. example of string: 22/03/2013 00h00 9940 10200 10260 10190 10030 10060 example of result: [22/03/2013 00h00, 9940, 10200, 10260, 10190, 10030, 10060] my problem in file, separator varies 1 line another example: 22/03/2013 00h00 9940 10200 10260 10190 10030 10060 22/03/2013 01h00 9970 9900 9970 9850 9830 9740 22/03/2013 02h00 9630 9750 10010 10100 10040 10010 how cut string ? you can try regex str.split("(?<!/\\d{4}) +");

documentation - In Enterprise Architect, can I export the structured specification of an element's scenario into a report? -

for each model element, there option in ea 10 create internal requirements , constraints , scenarios . of them end in reports if use pre-defined basic template . however, if select " structured specification " instead of default " description " text field scenario , end steps of structured specification being ignored in report output. how can have them included in reports? it sounds need create own reporting template. may seem bit daunting first time out , template editor pretty ornery, luckily can use existing template starting point. hit f8 bring generate documentation dialog, select templates tab. click new, specify name , select template copied. don't bother template group, , leave fragment checkbox unchecked. in editor, scroll down halfway (assuming selected copy basic template) , locate yellow scenario > tag. now in checkbox tree on left, scroll down package - element - scenario. note scenario checked, structured scenarios not. ch...

ajax Preloader is not working in chrome,safari while working in firefox -

i have problem in "ajax loader image". on firefox working fine on chrome ajax loader image not seems. i have attributes on sidebar when check attribute products changes according , preloader image generated before ajax completed.what doing when check on attribute first insert gif image in div html , show using .show() method , after success of ajax set div html null , hide it. you can see div in firebug ( <div id="ajax_loader_div" style="display:none;"></div> ) code complicated that's why not posting code here.really sorry that.you can see on http://vcompare4u.com/wpcompare/products/laptops/ i need help.please thanks!!! i've seen code it known synchronous requests lock ui. not surprisingly on chrome , safari, (it in firefox interestingly) can try jquery('#customtag_widget-2 .compare_attribute').bind('change', jquery.filterproductscompare2 = function () { $.ajaxsetup({async:false}); jquery(...

jquery - A potentially dangerous Request.Form error when paging through gridView in update panel -

please excuse me if duplicate question. have searched , found many posts regarding error, yet none of them seem me (perhaps due ignorance). i getting value of cell of gridview , placing in hidden field. gridview in updatepanel. here code (jquery): $('#<%=hdfcurrbatchid.clientid %>').val($('.selectedrow td:first').html()); this works fine when loading page , doing action on page. works ok when changing value of dropdownlist asyncpostbacktrigger updatepanel , causes grid reload (and hidden field value changes). works ok if change selectedrow. but if try page through grid, error: potentially dangerous request.form value detected client (ctl00$maincontent$hdfcurrbatchid=">t..."). i added web.config , still error (i using 4.0). dont want add valdiateinput = false because compromises security. there else can do? doing wrong way getting value of cell? thanks help. let me know if there other code need see. this because have content i...

android - What is the R.id.realtabcontent in FragmentTabHost example? -

looking documentation fragmenttabhost see r.id.realtabcontent in: mtabhost.setup(this, getsupportfragmentmanager(), r.id.realtabcontent); just don't uderstand did come , shall use. hint in advance. public void setup (context context, fragmentmanager manager, int containerid) thats container view. if don't understand it. try make linearlayout , put indicator in it, follow example understand better. in fact, constor exist without container : public void setup (context context, fragmentmanager manager)

matlab - The function sqrt() without parentheses returns weird value -

i've accidentally typed following in octave: sqrt 25 and got back: ans = 7.0711 7.2801 with parentheses, sqrt(25) returns correct result. happening without parentheses? matlab share same behaviour or specific octave? don't have matlab cannot check. octave interpreting length-2 char array, , converting these ascii representation (50 , 53), getting square root. can done in matlab using: sqrt(double('25')) matlab produces error sqrt isn't defined char inputs when used without parentheses.

css - Media query to turn site into mobile site -

i've been looking @ few websites, in order construct own websites, , i've noticed when zoom in past percentage, website emulates mobile display. no horizontal scrollbar appears, , fits onto page, , page length increases. here few example websites - https://generalassemb.ly/ , http://learnlayout.com/ , http://dev.opera.com/ i'm not sure how implement design, , have searched web explanation. if possible, walk me through example css? thanks this has nothing zoom, current width of window, ( @ least in examples, same happens when change browser's window smaller size ) using css media queries apply conditional styles depending on width. sample ( first google result http://css-tricks.com/css-media-queries/ ) @media , (max-width: 699px) , (min-width: 520px), (min-width: 1151px) { body { background: #ccc; } }

c# - Change width and height of column using ExcelPackage -

Image
i'm writing code nopcommerce webshop, needs export excel sheet. i'm trying edit width of columns, text fit in. tried following code(for 26 columns): //adjust excel column width (int = 0; < 26; i++) { worksheet.column(i, 1).width = 45; } the code executes , width of columns 45, works. gives me following error @ start up: how can rid of error? thanks in advance! have tried worksheet.column(i).width = 45; ?

Parsing a string returned from ckeditor using javascript string methods -

i trying area of data out ckeditor. in order use following code function get_body_html(){ var email = ckeditor.instances['message'].getdata(); var before_body = header_to + + to_subject + subject + subject_body; var s_index = email.indexof(before_body)+before_body.length; var e_index = email.indexof(body_footer); return email.substring(s_index,e_index); } for reason works when on page load ckeditor.instances.message.setdata(header_to + + to_subject+ subject + subject_body + body_text + body_footer); get_body_html(); it works correctly , gives me same string contained in body_text. but when this body_text = get_body_html(); ckeditor.instances.message.setdata(header_to + + to_subject + subject + subject_body + body_text + body_footer); in onclick function gets wrong indexs somehow. can't find string , returns -1 other times gets weird index doesn't make sense. these index variations happen when code changed tackle problem different ...

Is it possible to buffer the output of $app->run from silex? -

i wondering if possible store output created silex. want achieve : <?php require('core.php'); $out = $app->run(); echo $app['twig']->render('header.html'); echo $out; echo $app['twig']->render('footer.html'); i'd way because of navigation build inside dynamic controllers , registered global twig. i've tried use out buffering ob_start mechanism without succes : <?php require('core.php'); ob_start(); $app->run(); $out = ob_get_contents(); ob_end_clean(); echo $app['twig']->render('header.html'); echo $out; echo $app['twig']->render('footer.html'); any other ideas on subject ? instead of having split of header/main/footer , using global variables, should use unique template template inheritence. http://twig.sensiolabs.org/doc/templates.html#template-inheritance

java - System cannot find the file specified -

i have program in jar file, several csv files located in root directory of jar file. code importing files program looks : public static final string stringfile = "file.csv"; the error says "file.csv (the system cannot find file specified)." i'm wondering why wouldn't work if files in root directory of jar, there special need access them, or not possible , still need have path leading file? thanks! your example (if extrapolate you're doing new file(stringfile) ) file on file system in same directory run java file, not search classpath. you want either classloader.getresource() or classloader.getresourceasstream() you classloader issuing this.getclass().getclassloader()

VB.NET - Checking FTP directory exists always returns true -

can tell me why function below returns true, if ftp directory in question not exist? the value of directoryurl pass in of form: ftp://ip_address/directory/subdirectory/ and has trailing forward slash. public function doesdirectoryexist(directoryurl string) boolean ' check target url formatted if not directoryurl.startswith("ftp://") directoryurl = "ftp://" & directoryurl ' create web request dim request ftpwebrequest = directcast(webrequest.create(directoryurl), ftpwebrequest) request.credentials = new networkcredential(_username, _password) request.method = webrequestmethods.ftp.listdirectory ' try , list contents of directory try using response ftpwebresponse = directcast(request.getresponse(), ftpwebresponse) ' have been succesful directory exists return true end using catch ex webexception dim response ftpwebresponse = directcast(ex.response, ftpwebresponse) if response.statuscode = ...

ios - Lot of errors in Xcode every time I'm trying to add ZipArchive or ssziparchive -

Image
i have project in need add ziparchive files , unzip file download every time try errors after set everything(adding zlib in linker , needed files work). add imports needed , drag ziparchive in folder structure needed project. on getting rid of these errors? i've been trying few days , cant find problem. have xcode 4.6.3 , final error i'm getting: apple llvm compiler 4.2 error many errors emitted ,stopping now it looks you're including objective-c headers when compiling c code. result of .pch file. remove objective-c imports .pch file or ensure wrapped in ifdef prevent them being processed during c compilation ( #ifdef __objc__ ).

Java "File" works but "InputStream" does not -

edit: getresourceasstream() vs fileinputstream is best explanation have found. after trying different subclasses of inputstream feel implementation of inputstream returned fileinputstream() , 1 returned getresourceasstream() subtly different in way (causing incompatibility javax.xml.parsers.. ) i'll leave open while in case happens have answer, i'm done. advice, suggestions , help. time move on next thing. i've have servlet collects it's initialization data xml ini file, opens inputstream servlet session context this httpsession session = request.getsession(true); servletcontext ctx=session.getservletcontext(); inputstream myini = ctx.getresourceasstream("/web-inf/myini.xml"); that works, later on i'm writing junit tests , in setup function, , need access same ini. don't have servlet context in test environment try create inputstream using inputstream testing = new fileinputstream(string pathtofile); and also inputstream...

angularjs - How to make a tab active from the beginning in Angular Bootstrap UI? -

i'm trying make 1 of tabs active (tabs in template), depending on url params. unfortunately, make active default the first 1 found in html template , if use ng-repeat in example. this doesn't work: $scope.tabs = { title2: {active:false, content:"hello world 2!"}, title3: {active:false, content:"hello world 3!"}, title4: {active:false, content:"hello world 4!"} } $scope.tabs.title4.active = true; here fiddle: http://jsfiddle.net/alexrada/kfaxh/5/ you need use $routeparams service inside controller , set the $scope active value it. along these lines: .controller('mytabctrl', function($scope, $routeparams) { $scope.tabs[$routeparams.active].active = true; }) where url /?active=title4 you need set $routeprovider service. i'll see if can fork of jsfiddle work once becomes usable again (it's soooo slow currently...)

debugging - GNAT GPS Debugger - Could not initialize the debugger -

i attempting debug project in gnat's gps ide. every time chose debug->initialize->"program name" gui of gps switches of debug gui, , error pops "could not initialize debugger". the 2 possible solutions have found gdb.exe may out of date , suggests running outside of gps, run fine. other possible solution make sure -g tags applied when building project, necessary gnatlink , gcc debugging. states -g tag applied new project default, unless have removed it. doubt have, not sure check make sure still included. the other odd thing tutorial comes gps runs through how build , debug code works fine when initialize debugging on it. tutorial referring can accessed through help->gps->gnat programming studio tutorial. references program 'sdc' comes in gnat/2012/share/examples/gps/tutorial directory. any ideas on doing incorrectly, since error isnt helpful? thanks! at first sorta sounds path problem, if you're able run debugger tut...

PayPal Chained payments failing -

Image
i'm trying paypal's chained payments working in sandbox env. whenever click on "pay" @ last stage after signing in redirected page generic error message "your payment can't completed. please return participating website , try again." i've tried doing both chained , parallel payments same results. i've followed few suggestions around web inc tweaking merchant account settings making sure fields unchecked under "blocked" options. checking currency , country code. country code en_gb , currency gbp, didn't work tried doing en_us usd in cases same message. i've tried adding ipn url on off chance paypal post error code/message got nadda! if click "return test store" goes cancel url without post/get parameters. i'm using php sdk http://paypal.github.io/#adaptive-payments-tab-php-5-3 so question, have suggestion how can find out going wrong or other things can try fix it? i had problem in sandbox e...

c# - Allow the user to upload a document to the application -

Image
using orchard cms v 1.6 implement feature (1) allows user upload document (2) stores date uploaded (3) stores id of record uploaded is there part doing this. i've no idea how go this....any suggestions welcome...thanks edit as i'v said i've used advice create content type. created custom form , tried add content type(the media) custom form.(as explained on link provided http://devdirective.com/post/160/how-to-create-custom-forms-in-orchard-cms-with-email-and-recaptcha ) however when appears on screen on front end mediapicker box appears greyed out , doesnt allow me select it. 'browse' , 'clear' nothing....also how can remove option of permalink thanks create new content type whatever name want eg. myfileupload add title, autoroute , common part (common part store date content item created) add field , select media picker field (you can limit extensions allow .doc files if wish , make field required) something should work :) ...

mysql - MyBatis-Spring insert a list of objects and retrieve their new IDs -

i working mybatis-spring , mysql database. currently, inserting lists 1 of tables using following code: <insert id="insertlist" parametertype="java.util.list" usegeneratedkeys="true"> insert mytable (field1, field2, field3) values <foreach collection="list" item="item" separator=","> (#{item.field1}, #{item.field2}, #{item.field3}) </foreach> </insert> at point, return the new ids generated after inserting new items without making new query: select * mytable. is possible? in advance. if list size not large, loop insert in java code for(bean bean : list){ list.insert(bean); } in mapper.xml insert method should add <selectkey keyproperty="id" order="after" resulttype="java.lang.integer"> select last_insert_id() </selectkey>

How to configure SSH login with key pairs for a Linux VM using azure-sdk-for-python? -

i trying deploy linux vm on windows azure using azure-sdk-for-python. luckily, able configure vm password based authentication didn't succeed use ssh keys. can explain how can configure ssh login through azure-sdk-for-python? i found test code of creating linux vm ssh keys here: (see _create_vm_linux() function) https://github.com/windowsazure/azure-sdk-for-python/blob/master/test/azuretest/test_servicemanagementservice.py (it may not right example since in test guess works @ least.) seems linuxconfigurationset(self, host_name=none, user_name=none, user_password=none, disable_ssh_password_authentication=none) prepares authentication user_name, user_password , ssh. also, looks publickey , keypair classes used configure ssh login keys. however, these settings unclear me usage. think have ask details test code. for publickey, assume first parameter thumbprint of service management certificate , second parameter local path of ssh public key. pk = publickey(service_cert_thumbpr...

c# - sql server query performance issues -

i have table has columns of non-unique id n-columns of various data a date of when data updated i have query that, given date range, gets list of entries updated during date range , entry of last update prior 1 found. date range within day 07-10-2013 00:00:000 - 7-11-2013 00:00:000. eg. given 07-10-2013 00:00:000 - 7-11-2013 00:00:000, query found 2 entries id new data updatedate old data last updatedate 3 randomdata 7-10-2013 03:30:343 randomdata 7-05-2013 06:34:764 4 randomdata 7-10-2013 13:30:343 randomdata 6-09-2013 04:37:376 this result get. have query query slow because there 3 inner joins on table has lot of entries , wondering if think of way make query faster. using sql server 2000. table info non-unique id unique id (this auto increment id) various data collected updated date edit: indexes on id , updatedate query i'm using (generalizing it) ::warning:: it's not pretty ::warning:: ...

php - Using a hyperlink to submit a form instead of a button through an intermedite function is not working -

i want submit form through 'edit(param1,param2)' function in turn being called in either of 2 ways.. echo '<input type="button" value="delete" onclick="edit(\''.$key.'\',\''.$b.'\')"/>'; or echo '<a href="list_cadmin.php" onclick="edit(\''.$key.'\',\''.$b.'\')"><span class="bluetext">deactivate</span>'; the function edit() this: function edit(a,b) { var answer = confirm("do want deactivate ?") if (answer){ alert(a) document.getelementbyid('cid').value= a; document.getelementbyid('key').value= b; document.getelementbyid('fname').method='get'; document.getelementbyid('fname').action='samepage.php'; document.getelementbyid('fname').submit(); } } where $key , $b number , string values respectively. so, according above both should go...

testing - Connecting to remote tty using perl -

i developing test automation host connected 10 embedded controllers via serial ports (/dev/ttys*) to speed testing wish add more host , enable them talk controllers. controller must remain connected first host. the entire test automation software written in perl looking perl based solution. using device::serialport talk controllers. until did work fine is there way using device::serialport connect tty devices on remote machine if not there similar perl module can that thanks in advance if can connect remote host via ssh, can perl script run on remote host. maybe daemon. each script talks devices via local ttys, , talk each other on tcp or udp sockets, using protocol define.

objective c - iOS UIButton disappears after setting background image to nil -

i have uibutton has no title or initial background image. when pressed, button background image changes , when pressed again, set nil. ios 6.x, button disappears. here code: - (ibaction)resetall: (id) sender { [self reset]; (uiview *view in self.view.subviews) { if ([[[view class] description] isequaltostring:@"uiroundedrectbutton"]) { uibutton *thebutton = (uibutton *)view; int ntag = thebutton.tag; switch (ntag) { case 11: { thebutton.tag = 10; [thebutton setbackgroundimage:nil forstate:uicontrolstatenormal]; break; } case 21: { thebutton.tag = 20; [thebutton setbackgroundimage:nil forstate:uicontrolstatenormal]; [thebutton setenabled:yes]; break; } case 31: { thebutton.tag = 30; [thebutton setbackgroundimage:nil forstate:ui...

Understanding Python 3 lists printing None value for each element -

as noob in python i'm printing elements of list in version 3, , after comprehensive research couldn't find explanation kind of behavior. however, know every function must return value , when it's not defined function returns "null" (or "none" in python). why in case, after printing elements correctly prints "none" each element in list? >>> a_list = [1,2] >>> a_list [1, 2] >>> [print(f) f in a_list] 1 2 [none, none] none return value of print function. don't use [print(f) f in a_list] when mean for f in a_list: print(f) .

mysql - Binding Nulls in Java HashMap -

i making parameter input form query audit table. inputs not required. the sql query below, want java resolve to, works perfectly. returns rows want, based on input. select * _audit datediff(now(), `_audit_timestamp`) < 30 , (('smith' <> '' , _action__user = 'smith') or (_action__user = _action__user , 'smith' null)) , ((null not null , _action_searchkey null) or (_action_searchkey = _action_searchkey or _action_searchkey null)) , ((null not null , _action_customer null) or (_action_customer = _action_customer , _action_customer null)) order _audit_timestamp desc however, when try make work in java, returns no rows @ all. thinking has values in map. looking @ them in debugger, show "" instead of null string sqltext = "select * " + " _audit " + " datediff(now(), `_audit_timestamp`) < :days " ...

Android - Gridview, custom layout onclicklistener -

i have gridview 2 textviews inside it, when gridview populated, onclicklistener set returns position of item selected. want trigger method when 1 of textviews selected. is possible? if yes, how set up? edit 3 : inside activity whch populated gridview: retrieve string-array strings.xml , for loop examines each item inside array , searches condition based on item's name inside sharedpreferences, for loop solely counting how many "true" conditions there are, retrieves int saved inside count . new string[] created, required exact length given before items can added it, check count if it's more 0, give string[] length of count , for loop add each true string[] list created. if count 0 (no true conditions found in first for loop ) 1 item added string[] , given value "no favourites added". then have gridview's onitemclicklistener(). string s[] = getresources().getstringarray(r.array.fulllist); int count = 0; fo...

java - (kind of solved) How does server count time for "504 gateway time-out error"? -

i'm new web service. i'm using oracle jdeveloper call web service request data. need call function provided 40,000 times. use while loop , erratically returns "504 gateway time-out" error or "500 server error". "erratically" mean caught exception after 500 calls after several calls or @ beginning. what i've tried: reduce total number of calls increase requested data amount each call. result seems got error more (after 2 or 3 queries). my question is: how server count time? time-out server error related "time" or "frequency"? there way avoid error? thanks! updated - solution i reduced call frequency , when error popped up, asked waiting , recall after 30 sec.

java - Making group constraints in Regex in android -

so have string: string articlecontent = "dfgh{jdf%g{%qf234ad%22!#$56a%}vzsams{%3%45%}678456{78"; i want remove between {% %} so result : dfgh{jdf%gvzsams678456{78 i tried this: string regex = "[{%][^[%}]&&\\p{graph}]*[%}]"; string abc = articlecontent.replaceall(regex, ""); but is: dfghfgqf234ad}vzsams3}678456{78 what suppose i'm doing wrong not able make group of "{%" instead of [{%] or condition { or % . any suggestions? edit 1: string have taken example. can have special characters in between {% , %} not ! , % you can pattern: string regex = "\\{%(?>[^%]++|%(?!}))*%}"; explanations: the goal of pattern reduce @ minimum number of backtracks: \\{% # { need escaped (?> # open atomic group * [^%]++ # characters %, 1 or more times (possessive *) | # or %(?!}) # % not followed } (<-no need...