Posts

Showing posts from March, 2010

c++ Access class field from another class syntax -

i have 2 classes class book { public: int _pages; string* _name; }; class shelf { public: int shelfname; int _bookscount; book** _books; }; (with more irrelevant function , variables) and want create function calculate total pages on shelf, new oop tried do: double shelf:: getavg() { int sum, i; (int = 0; < __bookcount-1; i++)// count not considering inedx 0 { sum += _books[i]._pages;// need fixed<< } } i pretty sure problem last line syntax, can please guide me how correct it? thank in advance you have multiple errors there. senseless * in _name member typo _bookscount missing return in method getavg missing declaration of method getavg in shelf class and last, major error is, have member book** _books pointer of pointer, access if pointer. should declare _books book* _books . your code should (can) looks like: class book { public: int _pages; string _name; }; class shelf { public:...

java - Caesar Cipher with at least 5 methods -

i have been tasked with creating caesar cipher has main method, , has other methods named how want them within project requirements. i have been emailing teacher's assistant , forth on since haven't been directly told anyway on how shift ascii lettering i've been trying around on google , here bit , have set not use many methods i've been asked or it's in c language. my question stand is, netbeans ide 8.1 proper code shift .txt file. if asked i'll put rubric if asked of me. package mcintosh_project3; import java.io.file; import java.util.scanner; /** *james mcintosh *project 03 */ public class mcintosh_project3 { public static void main(string[] args, int option) throws exception { boolean run = true; file inputfile; if (option == 1) { scanner input = new scanner(system.in); system.out.println("what text file encrypt?"); string inputfile = input.nextline(); ...

html - How to validate a text in disabled field [Geb]? -

i have ui form have first select username field (ex: product) , if click on submit button popup window populates hidden field id , display field username (product). the display field set disabled="disabled" force user use popup , not type value in field.how validate below using geb spoc? <td class="data" style="white-space:pre"> <input id="amazon" class="formelement" name="amazon" size="20" role="textbox" disabled="disabled" type="text"> </td> i have tried below page objects , spec test page: selectuser {$("#amazon")} spec: assert selectuser.text() == "product" any ideas? you want use value() method because you're accessing value of input , not text() method not after inner text of input element.

python - Getting keys for specific a value in dictionary -

the reason why asking question because working huge datas. in algorithm, need this: users_per_document = [] documents_per_user = [] as understand names of dictionaries, need users clicked specific document , documents clicked specific user. in case have " duplicated " datas, , both of them overflows memory , script gets killed after while. because use large data sets, have make in efficient way. i think not possible need ask it, there way keys of specific value dictionary? because if there way that, not need 1 of dictionaries anymore. for example: users_per_document["document1"] returns appropriate users, need users_per_document.getkeys("user1") because return same thing documents_per_user["user1"] if not possible, suggestion pleased.. if using python 3.x, can following. if 2.x, use .iteritems() instead. user1_values = [key key,value in users_per_document.items() if value == "user1"] ...

mysql - How do I import/handle large text files for MS SQL? -

i have 1.7gb txt file (about 1.5million rows) apparently formatted in way columns , rows, though don't know delimiter. need able import data mysql , ms sql databases run queries on. i can't open in notepad see sample of data. for future reference, how 1 handle , manipulate large data files? file format best? knowledge excel , csv not support unlimited numbers of rows. you can use bcp in below bcp yourtable in c:\data\yourfile.txt -c -t, -s localhost -t hence know column name mysql, can create table structure before hand in sql server

php - Carousel Slider with query loop inside for featured custom post type -

Image
so i'm trying carousel slider display 3 posts @ time through loop featured custom posts type. this code have carousel: <div class="container"> <div class="row"> <h2>featured posts</h2> </div> <div class='row'> <div class='col-md-8'> <div class="carousel slide media-carousel" id="media"> <div class="carousel-inner"> <div class="item active"> <div class="row"> <div class="col-md-4"> <a class="thumbnail" href="#"><img alt="" src="http://placehold.it/150x150"></a> </div> <div class="col-md-4"> <a class="thumbnail" href="#"><img alt="" src="http://placehold.it...

javascript - Jquery change iside div width size, based on outside div size -

hi change value of div width, based on outside div width i new in jquery , javascript , tried code: if ($('col-md-4 col-sm-6').width() <= 320 ){ $('.card-info').width(120px) }; but didn't work... the html is: <div class="col-md-4 col-sm-6"> <div class="card-info"> </div> </div> <div class="col-md-4 col-sm-6"> <div class="card-info"> </div> </div> (...) could 1 me find out how that, change div "card-info" 120px width if div "col-md-4 col-sm6" 320px or less. thanks lot. you're not selecting col-md-4 , col-sm-6 class in jquery. missed dot(.) before $('col-md-4 col-sm-6') col-md-4 here , comma(,) , dot before col-sm-6 . solution if ($('.col-md-4, .col-sm-6').width() <= 320 ) { $('.card-info').width(120); } or if ($('.col-md-4, .col-sm-6').width() <= 320 ) ...

c# - Issue with asp Identity and Redis session state provider -

i have asp.net web forms application individual user identity. login works fine inproc session state provider. changed redis session state provider on azure works fine. login authenticates user logging in no identity saved. returned inproc session state provider, works again. understood identity (owin , asp) use cookies?

Add appropriate header files to Qt programs so that I can use Q_DECLARE_PRIVATE -

i want create shared library communicate database. want use pimple idea in implementation, don't know header files must added program qt can find q_declare_private , other macros. necessary add command .pro file?

python - Do Django backward relations add overhead? -

in django, create models , can optionally specify foreign key on field class man: ... class dog: ... owner = models.foreignkey(man, on_delete=models.set_null) you can query each dog respective owner or dogs man owner = some_dog.owner all_dogs = some_man.dog_set.all() if want not create backward relation specified the docs , can do class man: ... class dog: ... owner = models.foreignkey(man, on_delete=models.set_null, related_name='+') now no longer have access all_dogs = some_man.dog_set.all() . however, additional "building" of backward relation add overhead? if never ever used all_dogs = some_man.dog_set.all() matter whether or not had specified related_name='+' in dog ? slow things down potentially? and functionality purely implemented in application side django, or related_name='+' change database schema itself? however, additional "building" of backward relation...

sas - Keeping or deleting a group of observations based on a characteristic of a BY-group -

i answered sas question few minutes ago , realized there generalization might more useful 1 ( here ). didn't see question in stackoverflow. the general question is: how can process , keep entire by-group based on characteristic of by-group might not know until have looked @ observations in group? using input data similar earlier question: * reason, tasked keeping observations * in groups of id_1 , id_2 contain @ least 1 obs * value of 0.; * in following data, following id , id_2 groups should * kept: * 2 (2 obs) * b 1 (3 obs) * b 3 (2 obs) * b 4 (1 obs) * resulting dataset have 8 observations.; data x; input id $ id_2 value; datalines; 1 1 1 1 1 1 2 0 2 1 b 1 0 b 1 1 b 1 3 b 2 1 b 3 0 b 3 0 b 4 0 c 2 4 ; run; double dow loop solution: data have; input id $ id_2 value; datalines; 1 1 1 1 1 1 2 0 2 1 b 1 0 b 1 1 b 1 3 b 2 1 b 3 0 b 3 0 b 4 0 c 2 4 ; run; data want; _n_ = 1 1 until(last.id_2); set have; id id_2; flag = sum(flag,value=0); end; ...

node.js - Difference between $ node --debug and $ node debug -

i looking @ docs $ node --debug vs. $ node debug there seem behavioral differences between two. documentation should here: https://nodejs.org/api/debugger.html this part sort of explains difference: https://nodejs.org/api/debugger.html#debugger_advanced_usage but not 100% following saying. know actual difference between these too? it's explained in documentation linked to, under advanced usage : alternative way of enabling , accessing debugger start node.js --debug command-line flag or signaling existing node.js process sigusr1. once process has been set in debug mode way, can inspected using node.js debugger either connecting pid of running process or via uri reference listening debugger: node debug -p <pid> - connects process via pid node debug <uri> - connects process via uri such localhost:5858 so in short, --debug (or sigusr1) explicitly enables (v8) debug server , begins listening debugger connections. executing node debug lo...

python - How to apply custom maya manipulator with user defined context -

i'm learning maya scripting recent days , got confused how apply custom manipulator user defined context. select obj , click show manipulator tool doesn't work. question maybe stupid cannot find out how it. there example in devkit filmmovemanip.py , wanna know how use it. know how load it, way how manipulator shown , use it. add script filmmovemanip .py plugin_path , follow usage guide in file header: # filmmovemanip.py # scripted plug-in displays manipulator # modifies film translate horizontal , vertical # values. # # use plug-in: # 1. execute following python: # import maya # maya.cmds.loadplugin("filmmovemanip.py") # maya.cmds.spfilmmovemanipctxcmd( 'spfilmmovemanipcontext1' ) # maya.cmds.setparent( 'shelf1' ) # maya.cmds.toolbutton( 'spfilmmovemanip1', cl='toolcluster', t='spfilmmovemanipcontext1', i1="filmmovemanip.xpm" ) # 2. open outliner , select camera shape such perspsh...

sql server - How to import Excel data using SQL Query (without wizard)? -

say have thousands of excel files people's information. name height john 182 sam 178 ... if want import these data new ms-sql database table using sql query, how should that? name weights john 130 sam 160 ... and if want append 'weights' data previous table using query, how should that? the reason i'm doing because import excel using wizard can lead huge waste of time, i'm thinking if can embed sql query in matlab, loop job me, hopefully. thank in advance. you can use openrowset import excel table example : insert yourtable ( . . . ) select . . . openrowset('microsoft.ace.oledb.12.0', 'excel 12.0;database=c:\excel\excelfile.xlsx', 'select * [sheet1$]')

xml - NMTOKEN questions. Am I overthinking it? -

i have quick question regarding xml assignment. 1) assignment states need add nmtoken code. input code <!attlist catalog type nmtoken #required> ? or should put name it? there short section on nmtoken , nmtokens didn't state if needed make or not. the instruction the type attribute, required attribute of catalog element, containing valid xml name the code in file given fit instruction <catalog type="photos"> 2)the second question similar first in states use nmtokens. make similar code shown above nmtokens in place? there multiple code have similar element metadata . repeat code until have made string each metadata? the question the metadata attribute, required attribute of name element, containing list of valid xml names the codes fit instructions <name metadata="watch timekeeping pocket railway">pocket watch</name> <name metadata="hotel">bergenfield hotel</name> <name metadata="sweeney...

angularjs - $http.delete in angular js is not taking the data to node js server -

i tring make basic curd application, $http.delete not taking data node.js backend. service method in angular js. service.removeitem = function(delobj){ console.log(delobj); //var response = $http.delete(apibasepath + "/", {params : delobj}); var response = $http({ method: 'delete', url: apibasepath + "/", data:delobj }); return response; }; delobj like: {id: "5815bc7304c82b0b74caea51"} node.js backend: app.use(bodyparser.urlencoded({'extended':'true'})); app.use(bodyparser.json()); app.use(bodyparser.json({ type: 'application/vnd.api+json' })); app.delete('/' , function(req, res){ var id = req.body.id; console.log(id); todo.remove({_id : id}, function(err, count){ if(err) throw err; res.send("number of task removed : " + count); }); }); all other get,pos...

hadoop - How to make WordCount use new Java libraries in Cloudera? -

Image
i new hadoop, , trying example of wordcount v1.0 here: https://www.cloudera.com/documentation/other/tutorial/cdh5/topics/ht_usage.html however, when compile wordcount.java using line: javac -cp /usr/lib/hadoop/*:/usr/lib/hadoop-mapreduce/* wordcount.java -d build -xlint it seems code uses old version of .jar files, , gives me following warnings (as shown in picture). however, when check inside classpath declared, there .jar files seems newer versions of being required .jar files. so question how can make wordcount.java use newer file instead? tried looking inside wordcount.java code see rows use required .jar files not see them. in advance help. the code of wordcount.java import java.io.ioexception; import java.util.stringtokenizer; import org.apache.hadoop.conf.configuration; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.intwritable; import org.apache.hadoop.io.text; import org.apache.hadoop.mapreduce.job; import org.apache.hadoop.mapreduce.mapper; i...

ios - CKRecord set parent error 4097 -

i'm trying set parent on ckrecord. basically, reminder child of list. list exists on server. let record = ckrecord(recordtype: "reminder", recordid: recordid) let listid = ckrecordid(recordname: listname, zoneid: listzoneid) record["title"] = "test todo" record.setparent(listid) let modifyrecordsop = ckmodifyrecordsoperation(recordstosave:[record], recordstodelete:nil) modifyrecordsop.modifyrecordscompletionblock = { (_, _, error) in guard error == nil else { print(error) return } } every time this, following error: [logfacilityck] got connection error operation 28174dd7caf85542: error domain=nscocoaerrordomain code=4097 "connection service named com.apple.cloudd" userinfo={nsdebugdescription=connection service named com.apple.cloudd} if remove setparent line, record created on server. doing wrong? it because listid record not yet saved cloud, therefore cloud cannot set listid parent of record . t...

javascript - can not get the scope of 2nd controller withing same angular file -

i using 2 controllers home page. 1. controller handle search autocomplete (google maps api suggest locations). 2. controller handle remaining parts of page but scope of second controller not show up. ejs: <head> <title><%= title %></title> <link rel="stylesheet" href="/bootstrap/bootstrap.min.css"> <script src="bootstrap/jquery.min.js"></script> <script src="bootstrap/bootstrap.min.js"></script> <script src="angular/angular.min.js"></script> <script src="angular/locationcontroller.js"></script> <script src="angular/maincontroller.js"></script> <link rel='stylesheet' href='/stylesheets/style.css' /> <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="pragma" content=...

postgresql - PHP: The page isn’t redirecting properly, Too many redirects -

i tried implementing system wherein user enters username , phone number, when form submitted, checks database verify number , username based on it's existence. sms sent number. gets popup enter otp code. however on entering otp code error of redirecting loops. i'll explain flow of files below: index.php -> login.php -> otp.php -> check_otp.php -> home.php those files being used. reaches otp page , when enter, authenticate goes loop. post code see wrong otp authentication code. session_start(); // starting session $error=''; // variable store error message if (isset($_post['verify'])) { if (empty($_post['otp'])) { $error = "otp invalid"; } else { // post otp $otp=$_post['otp']; } $otp = stripslashes($otp); $otp = pg_escape_string($otp); $check = "select * otp otp = '$otp'"; $ret_check = $dbconnection->executequery($check); $ret_num = $dbconnection->numrows($ret_check); $cust_code = '...

Lookup an EJB Implementation by jndi name -

i new jndi namespace , trying lookup ejb class service class through below code initialcontext ctx; try { ctx = new initialcontext(); ctx.lookup("?????"); } catch (namingexception e) { // todo auto-generated catch block e.printstacktrace(); } but don't have clue put inside lookup. know jndi name goes there. can jndi name ejb class. new thing , can't devote time in learning jndi. refer server log file. when ejb beans deployed. looks jndi bindings session bean named sampleimpl in deployment unit subdeployment "sample-web-1.0.0.war" of deployment "xyz.ear" follows: sample code lookup ejb bean. final hashtable jndiproperties = new hashtable(); jndiproperties.put(context.url_pkg_prefixes, "org.jboss.ejb.client.naming"); final context context = new initialcontext(jndiproperties); sampleif sif = (sampleejbif) context.lookup("java:app/sample-ejb-1...

python - Installing PyQt (for pyuic4) after sip install goes OK: error: PyQt-x11-gpl-4.11 install -

after installing sip , keep getting lovely error message when trying install pyqt-x11-gpl-4.11 . mycommandline$ python configure-ng.py --verbose querying qmake qt installation... determining details of qt installation... /usr/bin/qmake -o qtdetail.mk qtdetail.pro make -f qtdetail.mk g++ -c -m64 -pipe -o2 -wall -w -d_reentrant -dqt_webkit -dqt_no_debug -dqt_core_lib -dqt_shared -i/usr/share/qt4/mkspecs/linux-g++-64 -i. -i/usr/include/qt4/qtcore -i/usr/include/qt4 -i. -o qtdetail.o qtdetail.cpp g++ -m64 -wl,-o1 -o qtdetail qtdetail.o -l/usr/lib/x86_64-linux-gnu -lqtcore -lpthread error: failed determine detail of qt installation. i can't figure out means. dependency issue? assuming you're using ubuntu, there's no need compile source pyuic4 . if install correct official packages, should included. just install either this: python 2: python-qt4 , pyqt4-dev-tools or this: python 3: python3-pyqt4 , pyqt4-dev-tools

concatenation - Concatenate time as text in Excel but ignore blank values -

i have several columns trying join in excel, including date , time. of rows have dates lot of time values blank. at moment have following formula: =concatenate(text(b2,"dd mmm yy "), text(c2,"[h]:mm")) this works fine when have date , time (eg 13 nov 16 10:50) if time column blank value result midnight (eg 13 nov 16 0:00). how can ignore blank values result displays (13 nov 16)? apply empty check on cell value. update formula - =concatenate(if(isblank(b2),"",text(b2,"dd mmm yy ")), if(isblank(c2),"",text(c2,"[h]:mm")))

Empty string increasing size by one in C++ -

the following code snippets output different results same input (7747774): a: #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string n; cin >> n; int k = count(n.begin(), n.end(), '4') + count(n.begin(), n.end(), '7'); string c = to_string(k); bool lucky = (k>0) && (count(c.begin(), c.end(), '4') + count(c.begin(), c.end(), '7') == c.size()); cout << (lucky?"yes":"no") << endl; return 0; } b: #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string n; cin >> n; int k = count(n.begin(), n.end(), '4') + count(n.begin(), n.end(), '7'); string c = "" + k; bool lucky = (k>0) && (count(c.begin(), c.end(), '4') + count(c.begin(), c.end(), '7') == c.size()); cout ...

jquery - Execute event on first click only -

i’m trying execute below click(function) on first click, executes whenever click on map. possible use one-click below code ? in advance var placedmarkers = 0; var availablemarkerstoplace = 1; settimeout( function(){ if(placedmarkers >= availablemarkerstoplace) return; placedmarkers++; var map = appery("google_map").gmap; google.maps.event.addlistener(map, 'click', function(event) { localstorage.setitem('selectedlat', event.latlng.lat()); localstorage.setitem('selectedlng', event.latlng.lng()); placemarker(event.latlng,map); alert(event.latlng); }); }, 1000); just create flag-value, decide, run function or skip: var placedmarkers = 0; var availablemarkerstoplace = 1; var clicked = false; settimeout( function(){ if(placedmarkers >= availablemarkerstoplace) return; placedmarkers++; var map = appery("google_map").gmap; google.maps.event.addl...

r - Keeping the main name of column using dcast -

i have rows same name , want convert them columns keeping main name of column , add 1 or 2 etc. according how many columns exist. i use make it: setdt(df)[, n:= 1:.n, maincol] df <- dcast(df, url~n, value.var=c("stock")) what expect have names stock_1, stock_2 etc. every column has number 1,2 etc. how can modify it?

php - Laravel get array in blade with such 'bns:OrderId' names in it? -

i array external company handle in laravel application the incoming json has names 'bns:orderid' in ? blade give error when try access {{ $order->bns:orderid }} how can handle this?? controller : public function getbolorders() { // or live api: https://plazaapi.bol.com $url = 'https://test-plazaapi.bol.com'; $uri = '/services/rest/orders/v1/open'; // public key $public_key = '<public key>'; //your private key $private_key = '<private key>'; $port = 443; $contenttype = 'application/xml'; $date = gmdate('d, d m y h:i:s t'); $httpmethod = 'get'; $signature_string = $httpmethod . "\n\n"; $signature_string .= $contenttype . "\n"; $signature_string .= $date."\n"; $signature_string .= "x-bol-date:" . $date . "\n"; $signature_string .= $uri; $signature = $public_key.':...

java - Searching a RandomAccessFile -

public void searchstaff(string name) { stafftemp retrieve = new stafftemp(); dates = new dates(); try { randomaccessfile file = new randomaccessfile(new file(stafffilename),"rw"); while () { retrieve.setid(file.readint()); retrieve.setfirstname(file.readutf()); retrieve.setlastname(file.readutf()); retrieve.setfaculty(file.readutf()); retrieve.setdepartment(file.readutf()); get.setdays(file.readint()); get.setmonths(file.readint()); get.setyears(file.readint()); retrieve.setpassword(file.readutf()); retrieve.setemployeddate(get); if (name.equals(retrieve.getfirstname()) ) { system.out.println(retrieve); } } file.close(); system.out.println("file retrieved\n\n"); }catch (ioexception eo) { system.err.println(eo.getmessage()); } } how c...

android - Cannot locate external database file on my phone -

i not able locate database file in external storage though have added permission. have add else? <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.newboston.location"> <uses-permission android:name="android.permission.access_fine_location"/> <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.write_external_storage" /> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name=".mainactivity"> <intent-filter> <action android:name="android.intent.action.main" /> <category ...

css - Bootstrap select - remove scrollbar + rounded corners -

Image
i'm using normal bootstrap select input, can't figure out how rid of unnecessary scrollbar, nor how apply border-radius actual dropdown in select. had no effect: select { overflow-y: auto; }

javascript - Bind event to jQuery.post and callbacks -

i using jquery.post lot in project , everytime browser sends post request, want show preloader while request in process , stop preloader when reply form server: var params = {'action':'get_customer_info', 'customerid':4}; preloader.start(); $.post('ajax/url', params, function(response){ preloader.stop(); responsehandler(response); }); instead of adding preloader.start() , preloader.stop() lines every time call jquery's post, i'd bind/trigger events on before jqeury.post on success/fail handlers. i know how bind , trigger events in general, i'm not sure how $.post , handlers. how do this? you set global ajax events, way preloader shows on every ajax request $(document).ajaxsend(function() { preloader.start(); }).ajaxcomplete(function() { preloader.stop(); }); or create own post function function post(url, params) { preloader.start(); return $.post('ajax/url', params, function(respon...

c# - Execute commands on AccesKey pressed & release -

so i'm trying execute command when user pressed acceskey , command when user releases acceskey. i tryed working timer executed code after 500 miliseconds didnt worked out. so far have this: public sealed class custombutton : button { private bool _ispressed = false; protected override void onaccesskey(accesskeyeventargs e) { if (!_ispressed) { //execute command when pressed _ispressed = true; } //execute command when acceskey released } } what have writen not wpf... wpf in xaml file: `<button name="btnwebbackward" width="24" mousedown="btnwebbackward_mousedown" mouseup="btnwebbackward_mouseup" ></button>` and in code behind: private void btnwebbackward_mousedown(object sender, mousebuttoneventargs e) { } private void btnwebbackward_mouseup(object sender, mousebuttoneventargs e) { } as can see, approach of creating own button have no sense.. ...

angular - angular2-router-loader lazy loading webpack error -

i have angular 2 project webpack , i'm trying implement router lazy loading: import { ngmodule } '@angular/core'; import { routermodule } '@angular/router'; @ngmodule({ imports: [ routermodule.forroot([ { path: '', loadchildren: './app/projects/projects.module#projectsmodule', } ]) ], exports: [ routermodule ] }) export class approutingmodule {} to make worked tried use angular2-router-loader . followed instructions , added loaders in webpack config. module.exports = [ { entry: { core: './node_modules/core-js/client/shim.min.js', zone: './node_modules/zone.js/dist/zone.js', reflect: './node_modules/reflect-metadata/reflect.js', system: './node_modules/systemjs/dist/system.src.js' }, output: { filename: './wwwroot/js/[name].js' }, target: 'web', node: { fs: "empty" }...

css - Click and Hold event listener with Javascript -

i want make page click , hold event effect, http://andeinerseite.video/ or http://2016.makemepulse.com/ , i'm interested in framework uses create effects. you can use javascript's settimeout function , bind mousedown events. have @ snippet below: // click , hold event listener var timeout_id = 0, hold_time = 1000, hold_menu = $('.hold_menu'), hold_trigger = $('.hold_trigger'); hold_menu.hide(); hold_trigger.mousedown(function() { timeout_id = settimeout(menu_toggle, hold_time); }).bind('mouseup mouseleave', function() { cleartimeout(timeout_id); }); function menu_toggle() { hold_menu.toggle(); } ul.hold_menu { list-style: none; padding: 0; margin: 0; } ul.hold_menu a, div.hold_trigger { display: inline-block; padding: 5px 15px; border: 1px solid #ccc; width: 300px; } ul.hold_menu a:link, ul.hold_menu a:visited { color: black; text-decoration: none...

Displaying a checkbox column in a Flex DataGrid -

i trying create custom flex datagrid consists of 2 columns, 1 label , other checkbox. checkbox contained within class called customrenderer inherits griditemrenderer , implements ifactory. in each instance of customrenderer, have variable called number when checkbox clicked, can pass number know row has been clicked. the problem customrenderer not show when program runs. please help. here code. myprogram.mxml <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minwidth="955" minheight="600" initialize="initdata()"> <fx:script> <![cdata[ import mx.collections.arraycollection; import mx.controls.alert; import mx.controls.checkbox; import m...

c# - Datetime.Now.ToString("HHmm") changed behavior -

i'm using line of code set string value current hour:minute in 24 hours format. example 14:50. problem it's 14:50 pm here , function returns 02:50, , causing big problem. idea how did changed in of our servers? both in test , production. thanks.

bluemix blockchain fmt.println not printed to log -

Image
i deployed marbles demo bluemix. not see go fmt.println statements in log. how programmer print bluemix log? --ken ken, if using built-in deploy (demo chaincode tab) going install marbles code public github repository appropriate bluemix instance. if looking fmt.println statements in logs, should make sure looking @ logs chaincode execution (network tab), not logs of peers themselves. if looking edit demo code insert own log statement @ specific places, need create own fork of public marbles demo code , not use built-in deployment. can either run marbles application locally pointing blockchain instance hosted on bluemix or deploy edited code bluemix well. should find additional instructions deploy paths in readme.md of marbles demo repository, depending on preference. recommend running application locally first. hope helps!

django - how to use StreamingHttpResponse in render_to_response -

i tried use streaminghttpresponse in render_to_response,but failed. codes below: def index(request): def test(): yield "nihaoma" import time time.sleep(5) yield "shidene" yield "haodene" #return streaminghttpresponse(test()) return render_to_response("result.html",{'output':streaminghttpresponse(test())}) i can want return streaminghttpresponse(test()),however,i want let string print browser can more goodlooking,so want print in result.html templete file , tried use render_to_response("result.html",{'output':streaminghttpresponse(test())}),but can not print strings in def test(),it print <django.http.response.streaminghttpresponse object @ 0x7f71dbfa05f8> browser. my result.html file content is: {% extends "base.html" %} {% block extrastyle %} <style> #myoutput{ position:fixed; top: 30%; left: 50%; width:...

angularjs - Dynamically added attributes don't initialise -

i trying dynamically add attributes html elements generated , compiled in ng-repeat statement. i using following directive on input elements. .directive('ngloading', function($compile) { return function(scope, element, attrs) { scope.$watch(attrs.ngloading, function() { element.attr('ng-required', true); element.attr('ng-pattern', '/^[0-9]+$/'); element.removeattr('ng-loading'); $compile(element)(scope); }); }; }); the problem seeing in fact add attribute, ng-required="true" etc. doesn't initialized browser , validation doesn't kick in.

Most performant way in SQL Server to condense multiple data changes into before and after values -

Image
i have sql server database audit records showing changes third party database (openedge). have no control on structure of audit data, nor way third party database audits data changes. i'm left with, example, following data... if follow first 5 rows can see belong transid 1532102 (represents database transaction) transseq represents database action within single transaction. in columns prefix new audit changes visible. if value null no change field took place. looking @ data can see transid = 1532102 primaryidentifier changed 2 -2 (row 1), -2 3 (row 3), 3 4 (row 4) , 4 5 (row 5). might notice when primaryidentifier changes 3 4 secondaryidentifier changes 'abcd' 'efgh' (row 4). these multiple changes occurring on single source record. in mind rows 1, 3, 4 & 5 can condensed single row (see below) ultimately there 2 record changes in transid 1532102.. i need translate these changes single update statement on target database. in order need ...

php - Block certain files from being uploaded -

i need stop php, pl, cgi being uploaded website. how possible? i've tried many weird things , have no hope it, never work. so yes, php, pl , cgi needs blocked. code: <?php session_start(); /** * handles post uploads, generates filenames, moves files around , commits * uploaded metadata database. */ require_once 'classes/response.class.php'; require_once 'classes/uploadexception.class.php'; require_once 'classes/uploadedfile.class.php'; require_once 'includes/database.inc.php'; /** * generates random name file, retrying until unused one. * * @param uploadedfile $file * * @return string */ function generatename($file) { global $db; global $doubledots; // start @ n retries, , --n until give $tries = pomf_files_retries; $length = pomf_files_length; $ext = pathinfo($file->name, pathinfo_extension); // check if extension double-dot extension and, if true, override $ext $revname = strrev($file-...

android - Add checked CheckBox in Array, remove unchecked one from Array -

i can check several checkboxes can uncheck them before clicking button. have table in insert clicked checkbox. problem 1 uncheck inserted. code: public class inscriptionassuranceremorqueur extends appcompatactivity implements adapterview.onitemclicklistener, view.onclicklistener { public static arraylist<assurance> assurancearray = new arraylist<assurance>(); private listview list_assurance; private button btn_confirmation; private checkbox checkbox; private double largeur; private double longueur; private double poids; private string nom; private string mail; private string tel; private string mdp; private textview txt; arraylist<assurance> tab = new arraylist<assurance>(); private checkbox chkios; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.fen_inscription_assurance_remorqueur); //intent intent x = this.getintent(); nom = x.getextras().getstring(...

identityserver3 - Cannot use refresh token to obtain new access token and refresh token in Identity Server 3 implementation -

Image
i've been playing around thinktecture's identity server , have problems trying reach refresh token endpoint. what have few clients configured this: authorization code flow client: new client { clientid = "tripgalleryauthcode", clientname = "trip gallery (authorization code)", flow = flows.authorizationcode, allowaccesstoallscopes = true, requireconsent = false, redirecturis = new list<string> { "redirecturi" }, clientsecrets = new list<secret>() { new secret("somesecret".sha256()) } } hybrid flow client: new client { clientid = "tripgalleryhybrid", clientname = "tripgalleryhybrid (hybrid)", flow = flows.hybrid, allowaccesstoallscopes = true, requireconsent = false, identitytokenlifetime = 10, accesstokenlifetime = 120, // redirect = uri of mvc application re...