Posts

Showing posts from February, 2012

python - Regex for name extraction on text file -

python - Regex for name extraction on text file - i've got plain text file containing list of authors , abstracts , i'm trying extract author names utilize network analysis. text follows pattern , contains 500+ abstracts: 2010 - nuclear forensics of special nuclear material @ los alamos: 3 recent studies purchase article david l. gallimore, los alamos national laboratory katherine garduno, los alamos national laboratory russell c. keller, los alamos national laboratory nuclear forensics of special nuclear materials highly specialized field because there few analytical laboratories in world can safely handle nuclear materials, perform high accuracy , precision analysis using validated analytical methods. i'm using python 2.7.6 re library. i've tried regex = re.compile(r'( [a-z][a-z]*,+)') print regex.findall(text) which pulls out lastly names only, plus capitalized words prior commas in abstracts. using (r'.*,') works extrac...

Python. Sqlite Encoding. Help me understand this -

Python. Sqlite Encoding. Help me understand this - im confused behavior, "image" string taken sqlite db. not work: tweet_sent = api.update_with_media(image, tweet) this works: tweet_sent = api.update_with_media(str(image), tweet) the first 1 gives me error: unicodedecodeerror: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128) if string kept in sqlite db "string" (varchar), why calling str on string solves problem? i guess doesn't have tweepy or string itself, anyway "image" string: /home/alejandro/proyectos/ol_bit_twit/ol_imagenes/2.jpg python sqlite

database - php search bar when I press submit with nothing in the search bar it shows all the data -

database - php search bar when I press submit with nothing in the search bar it shows all the data - the search fusion works correctly if press submit nil in search bar shows data. how message show saying nil has been entered search bar ?.i new php. <?php $mysql_host="host"; $mysql_database="database"; $mysql_user="username"; $mysql_password="password"; $dbconnect=@mysql_connect($mysql_host, $mysql_user, $mysql_password); // trys connect database if (!$dbconnect) { exit("an error has occurred - not connect database."); // if couldn't connect, allow user know } if(!mysql_select_db($mysql_database)) { exit("an error has occurred - not select database."); //if couldn't select db, allow user know } $output = ''; //collect if(isset($_post['search'])...

bluetooth - BLE - HCI LE Advertising Report event data format -

bluetooth - BLE - HCI LE Advertising Report event data format - bluetooth standard v4.0 [vol. 2, 7.7.65.2] allows controller "queue advertising reports , send info multiple devices in 1 le advertising study event". to manage feature, hci protocol includes, among event parameters, field num_reports (with values between 1 , 25). in case num_reports > 1, how event parameters organized in event packet received through hci? note 1: bluetooth standard seems specify unusual ordering of data, not packing each advertising study after other (as suggested event description), packing instead each type of info after other (i.e. event_types each advertiser, followed address types, addresses, , on till lastly field, rssi values). understand well? note 2: didn't find software illustration managing more 1 advertising study in 1 single event. mean feature of standard isn't used real-world devices? you understand correctly. when there more (num_reports ...

mysql - Database approach for different product types -

mysql - Database approach for different product types - my e-commerce application has different product/service types listed. each product/service type has different properties/attributes. example, mobile phone have different attributes cdma/gsm , tv have different set of attributes usb/hdmi. many product types available in starting , maintain on adding different product/service types. so question is, should need have different table each product/service type in database because each product/service has different attributes (columns) or there different, improve approach? estimated count of product/service types 50+. your case instance of class/subclass or type/subtype. buzzphrase in er modeling "generalization/specialization". here's list of tags pertain questions yours: single-table-inheritance class-table-inheritance shared-primary-key if read tag wiki these 3 tags, you'll general pointers on designing case outline. in addition, questions ta...

vba - If, Then, Duplicate Excel Formula -

vba - If, Then, Duplicate Excel Formula - column "a" numbering column each row, numbers same, ie.. a1 1 a2 3 a3 1 a4 3 i need formula show how many cells content in column without counting duplicates, above 2. figuring "if-then" formula unable straight. help out there? give thanks in advance! if you're using excel 2013, want there's count distinct function. nonetheless, can this: =sum(if(frequency(a1:a4,a1:a4)>0,1)) edit: adding explanation. frequency function gets frequency of unique values within array a1:a4 (first parameter), binning using values within a1:a4 (second parameter). if checks see if returns anything, i.e. if frequency greater 0, in case returns 1 each unique value finds. sum adds number of 1s returned if statement, in turn giving number of unique values within array a1:a4 . excel vba if-statement duplicates formula

asp.net mvc - Does not load js and css from CDN URL incase of secure pages with protocol "https" -

asp.net mvc - Does not load js and css from CDN URL incase of secure pages with protocol "https" - i implementing code in .net mvc loading js , css cdn url , works protocol "http". if site secure ssl js , css not cdn url on secure pages. what should resolve this? please give me suggestions. thank you. if site running on https css , javascript files must come secure server. security measure prevent things man-in-the-middle attacks. so reply create sure css & js files served using https. asp.net-mvc ssl cdn

dovecot - how to set alias all@example.com means all the user in my email on postfix -

dovecot - how to set alias all@example.com means all the user in my email on postfix - i utilize centos 6.5 server install mailserver.and works well.but there 2 question. how can set all@example.com means users.this mean when send email all@example.com,all users can received. how can allow dovecot if dovecot can’t find users in mysql, may still looking scheme users. here postfix main.cf: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 html_directory = no inet_interfaces = inet_protocols = local_recipient_maps = mail_owner = postfix mailbox_size_limit = 0 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = localhost mydomain = example.com myhostname = example.com mynetworks = 127.0.0.0/8 [::1]/128 myorigin = /etc/mailname newaliases_path = /usr/bin/newaliases.po...

c++ - GetOverlappedResults blocks with bWait = false -

c++ - GetOverlappedResults blocks with bWait = false - getoverlappedresults() not homecoming @ all. ran simple illustration bellow , when there ip address alter in network interface manual reset event gets set , can see "ip address table changed.." output, getoverlappedresults() not homecoming though bwait false. bwait = true should homecoming because event set hence i/o operation complete. what going on? #include <winsock2.h> #include <iphlpapi.h> #include <stdio.h> #include <windows.h> #pragma comment(lib, "iphlpapi.lib") #pragma comment(lib, "ws2_32.lib") void main() { overlapped overlap; dword ret, nr; handle hand = null; overlap.hevent = createevent(null, true, false, null); ret = notifyaddrchange(&hand, &overlap); (;;) { if ( waitforsingleobject(overlap.hevent, infinite) == wait_object_0 ) { printf("ip address table changed..\n"); ...

MongoDB findAndModify. Is it really atomic? Help writing a closed update solution -

MongoDB findAndModify. Is it really atomic? Help writing a closed update solution - i have event documents, consisting of embedded snapshots . i want add together snapshot event if: that event started within 5 mins of snapshot a the latest snapshot on event not greater min before snapshot a. otherwise.... create new event . here findandupdate query might create more sense: event.findandmodify( query: { start_timestamp: { $gte: newsnapshot.timestamp - 5min }, last_snapshot_timestamp: { $gte: newsnapshot.timestamp - 1min } }, update: { snapshots[newsnapshot.timestamp]: newsnapshot, $max: { last_snapshot_timestamp: newsnapshot.timestamp }, $min: { start_timestamp: newsnapshot.timestamp } }, upsert: true, $setoninsert: { our new event fields } } ) edit: unfortunately, cannot create unique index on start_timestamp. snapshots come in different timestamps, , want grouping them event. i.e snapshot comes in @ 12:00:00, , snapshot b c...

ios - viewDidLoad is called twice when transitioning from UITableViewController -

ios - viewDidLoad is called twice when transitioning from UITableViewController - when have force segue uitableviewcontroller regular view controller, viewdidload method gets called twice. makes content on sec view controller appear twice. thought viewdidload supposed called once. here code in happening. viewdidload -(void)viewdidload{ [super viewdidload]; //change table view cell height if ipad uidevice *device = [uidevice currentdevice]; self.isipad = (device.userinterfaceidiom == uiuserinterfaceidiompad); //initialize quiz [self initializethequiz]; } push segue - (ibaction)showquiz:(id)sender{ uibutton *senderbutton = (uibutton *)sender; if (senderbutton.tag <= 7 && senderbutton.tag >= 0) { [self performseguewithidentifier:@"showquiz" sender:sender]; }else{ [self performseguewithidentifier:@"showfunfacts" sender:sender]; } } here how perform force segue - (ibaction)s...

html - How to keep the styles of webpage the same -

html - How to keep the styles of webpage the same - i want know if there way create form maintain styles of webpage, while changing content of content of page. ex: when submit question stackoverflow, keeps stylistic parts of page, i.e. header , sidebars, while changing title , bulk of page's content. if can server-side languange, such php, best or web-side languange, such javascript, best you can css can devide page many files such putting header in page (header.html) , include in main page using php (include_once('header.html')) html css

Using MAMP with NGINX -

Using MAMP with NGINX - i see latest versions of mamp include nginx 1.6. can nginx used instead of apache, or beingness used server cached content. if possibel i'd rather utilize nginx directives instead of .htaccess. looks can utilize nginx web-server instead of apache. nginx mamp mamp-pro

sql - how to select characters after first 20 characters from field mysql -

sql - how to select characters after first 20 characters from field mysql - select address (first 20 character) address1 , address (characters after first 20 if less 20 null) address2 client how select string after 20 characters? to characters after first 20 characters (note if there not 20 characters, function homecoming empty string): select substring('some random address longer 20 characters' 20); now if need address 2 null, check character length first: select if(char_length(address) > 20, substring(address 20), null); to first 20 characters, can utilize substring function this: select substring('some random address', 1, 20); now final query this: select substring(address, 1, 20) address1, if(char_length(address) > 20, substring(address 20), null) address2 client mysql sql phpmyadmin

windows - What is correct way to use NVM? -

windows - What is correct way to use NVM? - problem while switching node versions in windows. i have installed nvm windows scheme manage node versions, have installed nodejs before version using nvm. can check image attached improve clarifications. please find link image stackoverflow not permitting me post images less 10 repo. http://i.stack.imgur.com/np9tp.png from image can create out, nvm list displayed multiple versions of node asking me install 1 time again , agaian when switch , use. can assist me this. wrong this? you may experiencing issue architecture. seek typing nvm arch 32 set scheme default 32-bit, nvm install 0.10.32 , , nvm utilize 0.10.32 . fact tool showing ?-bit architecture means having problem deciphering scheme architecture you're using. as author of nvm windows, i'd know version of windows you're running on , whether you're running 32 or 64 bit windows installation. if there bug or can create problem not happe...

liquibase - Where to put databasechangelog for a Oracle read-only user -

liquibase - Where to put databasechangelog for a Oracle read-only user - this sounds silly question please bear me. i have oracle database, written user owner. database created liquibase, , databasechangelog , databasechangeloglock tables reside in owner schema. far, good. now i'd create read user, reader. reader needs read access table owner.person, nil else. here's i've done far: as database admin: create user reader identified "password"; grant create session reader; -- necessary reader connect db grant create synonym reader; -- should reader needs see then owner: grant select on person reader; and finally, reader: create or replace synonym person owner.person; now reader can connect database and select firstname, lastname person; succeeds. i'd liquify this. in owner.xml say: <changeset author="me" id="owner_grants"> <preconditions onfail="continue"> <dbms type=...

Autorun Gulp task 'watch' on Webstorm launch -

Autorun Gulp task 'watch' on Webstorm launch - is there way run gulp task on webstorm launch? tried looking through webstorm settings don't see anything, gulp integration brand new webstorm 9. gulp.task('watch', function () { gulp.watch(paths.watch.css, function(){ compileless(paths.src.css, paths.dest.css, {name: 'style'}) }); gulp.watch(paths.watch.cssbootstrap, function(){ compileless(paths.src.cssbootstrap ,paths.dest.cssbootstrap, {suffix: '.min', name: 'bootstrap'}) }); gulp.watch(paths.watch.scripts, ['scripts']); gulp.watch(paths.watch.libraries, ['libraries']); }); just want way run gulp 'watch' (if project has gulp , task called watch) when ever start webstorm. no:( webstorm (as other jetbrains ides) doesn't back upwards 'on launch' actions - see https://youtrack.jetbrains.com/issue/web-11818#comment=27-787220 gulp webstorm

Wayfinder IncludeDocs parameter in Modx is breaking the snippet -

Wayfinder IncludeDocs parameter in Modx is breaking the snippet - i'm quite stuck on unexpected problem. i'm trying utilize wayfinder generate sitemap project. output of navigation items expected, need include number of documents in add-on primary navigation elements. to this, have used includedocs parameter. [[wayfinder? &startid=`0` &includedocs=`17,18,19,20`]] when this, no output @ all. remove includedocs , standard nav (expected). utilize param , output empty. no thought i'm doing wrong or (if any) other setting must defined in order create work. the includedocs parameter misleading. should rather named "onlyincudedocs" or "restrictto", since does. requires docs include straight accessable startid, alternatively have entire path "included". i suggest create weblink resources straight under startid, , link them resources want include. way wayfinder pick them default. (note may need handle in rowtpl way...

android - Change ImageView background when radioButton is clicked inside RadioGroup -

android - Change ImageView background when radioButton is clicked inside RadioGroup - in application have 2 radio buttons place within radio grouping , have single image view. 2 radio buttons choices name sun , moon , image view set sun image. i want alter set image moon when clicked radio button name moon. how can within radio group? radiogroup radiogroup = (radiogroup) findviewbyid(r.id.[add id here <---without [].]); int checkedradiobutton = radiogroup.getcheckedradiobuttonid(); switch (checkedradiobutton) { case r.id.radiobutton1 : imageview.setbackgroundimage(r.drawable.sun); break; case r.id.radiobutton2 : image view.setbackgroundimage(r.drawable.moon); break; } note - functionality, without xml. suppose smart plenty manage hook xml. note2 - might mistaking this: setbackgroundimage. might bit different. android android-imageview android-radiogroup

jquery - API skips authenticity verification with versionist gem -

jquery - API skips authenticity verification with versionist gem - i trying implement verify authenticity rails app, seems rails feature and can't figure out callback failing... so here applicaiton controller: class applicationcontroller < actioncontroller::base protect_from_forgery end here api controller: class v1::managerleadscontroller < applicationcontroller def create manager_lead = managerlead.create!(manager_lead_params) render json: manager_lead end private def manager_lead_params params.require(:manager_lead).permit(:first_name, :last_name, :email, :phone, :company, :format, :requested_date, :meeting_type, :has_complited_wholesale_investor_form ) end end and here logs: started post "/api/v1/manager_leads" 127.0.0.1 @ 2014-10-24 10:29:46 +1100 processing v1::managerleadscontroller#create json parameters: {"manager_lead"=>{"first_name"=>"", "last_name"...

c++ - Why can't we use nested type through class-member-access expression? -

c++ - Why can't we use nested type through class-member-access expression? - i'm trying understand why can't utilize nested type through class-member-access expression. instance, have next class: struct u { struct { static int v; int a; }; struct b { int b; }; }; u a; typedef a.a t; //'a' not name type int main() { std::cout << typeid(a.a).hash_code(); //invalid utilize of 'struct u::a' struct a.a b; //trying declare variable of type u::a //error: expected unqualified-id before '.' token a.a b; //the same above //error: expected unqualified-id before '.' token a.a.v = 5; //error: expected unqualified-id before '.' token } demo the standard says: section n3797::5.2.5/2 [expr.ref] ...

arrays - Java Lotto Number Generator LOOP -

arrays - Java Lotto Number Generator LOOP - i came code prints me 1 line of 5 random lotto numbers , 1 random mega number. need create loop asks user "how many tickets like?", prints amount of lines user asks, instead of 1 line. how this? believe loop, im not sure. public static void main(string[] args) { int[] lottonumber = new int[6]; { lottonumber[0] = (int) ((47 * math.random()) + 1); lottonumber[1] = (int) ((47 * math.random()) + 1); lottonumber[2] = (int) ((47 * math.random()) + 1); lottonumber[3] = (int) ((47 * math.random()) + 1); lottonumber[4] = (int) ((47 * math.random()) + 1); lottonumber[5] = (int) ((27 * math.random()) + 1); } system.out.println("lottery numbers: "); for(int i=0; i<1; i++) { system.out.print(lottonumber[0] + " " ); system.out.print(lottonumber[1] + " " ); system.out.print(lottonumb...

NServiceBus Version 5 Asp.NET MVC -

NServiceBus Version 5 Asp.NET MVC - we have asp.net mvc 4 website using nservicebus send messages various services. because our dev environments don't have these services installed, stub servicebus instance local development. utilize autofac module registered in our application_start set , configure our bus instance injection controllers. my nsb 3.3 configuration: public class servicemodule : module { protected override void load(containerbuilder builder) { builder.register<ibus>((c, p) => { var useservicebus = bool.parse(configurationmanager.appsettings["useservicebus"]); if (useservicebus) { homecoming nservicebus.configure.with() .log4net() .defaultbuilder() .xmlserializer() .msmqtransport().istransactional(false).purgeonstartup(false) .msmqsubscriptionstorage() .unicastbus().impersonatesender(false) .createbu...

odeint thrust slows down massively when using nested zip_iterators -

odeint thrust slows down massively when using nested zip_iterators - i building analysis tool on top of odeint , thrust. tool solves big number of initial status problems. have had success next odeint , thrust tutorials / demos. until now, systems have been working have had less 5 state variables, need extend scheme capable of handling more. as mentioned in tutorial, there little problem thrust's tuples can have 10 items. problem can solved using nested zip_iterators. quoting near bottom of one of tutorials: "a little difficulty thrust's tuples have maximal arity of 10. little problem since can create zip iterator packed zip iterators. top level zip iterator contains 1 zip iterator state, 1 normal iterator parameter, , 1 zip iterator derivative." i have implemented solution, , works, unfortunately massive loss in speed. same scheme (a two-variable system, simultaneously solving 8192 initial conditions), original, simple not-extensible more 5 v...

ruby on rails - Using :reject_if => :all_blank on double nested forms -

ruby on rails - Using :reject_if => :all_blank on double nested forms - so have next models pet class pet < activerecord::base # associations has_and_belongs_to_many :owners accepts_nested_attributes_for :owners, :reject_if => :all_blank end owner class owner < activerecord::base # associations has_and_belongs_to_many :pets has_one :phone_number, :as => :callable, :dependent => :destroy has_one :address, :as => :addressable, :dependent => :destroy accepts_nested_attributes_for :phone_number accepts_nested_attributes_for :address end phone number class phonenumber < activerecord::base belongs_to :callable, polymorphic: true end address class address < activerecord::base belongs_to :addressable, polymorphic: true end i have top level form_for @pet f.fields_for :owners nested within , f.fields_for :phone_number , f.fields_for :address both nested within f.fields_for :owners block. means params.require...

java - Apache Tomcat in OS X 10.10 Yosemite -

java - Apache Tomcat in OS X 10.10 Yosemite - i'm using mac os x 10.10 yosemite , trying run netbeans webapp using apache tomcat 8, whenever seek startup server next output: 29-oct-2014 00:40:31.158 info [main] org.apache.catalina.startup.catalina.start server startup in 8412 ms and after seconds "failed starting server" message appears. the server used work in os x 10.9, thought in wrong? it got solved changing java version 1.8 java osx apache tomcat osx-yosemite

java - publishResults in getFilter() -

java - publishResults in getFilter() - i'm making filter in order have autocomplete feature in actv. @override public filter getfilter() { filter filter = new filter() { @override protected filterresults performfiltering(charsequence constraint) { if (constraint != null) { (friendsmodel item : friend) { if (item.getname().tolowercase().startswith(constraint.tostring().tolowercase())) suggestions.add(item); } filterresults filterresults = new filterresults(); filterresults.values = suggestions; filterresults.count = suggestions.size(); homecoming filterresults; } else { homecoming new filterresults(); } } @override protected void publishresults(charsequence constr...

cuda - How to get GPU utilisation % on GeForce running Linux? -

cuda - How to get GPU utilisation % on GeForce running Linux? - i seek in formations gpu (geforce gtx titan black) memory used or gpu utilization. found on lot of posts talking le nvml library. but, geforce not compatible library. using linux, can not utilize nvapi library. but programme nvidia-settings can show % rate of memory , gpu usage. question is: whay inquire nvidia driver kind of informations? thanks linux cuda nvidia nvml

angularjs - Directive to disable and show load sign on a button during http-request -

angularjs - Directive to disable and show load sign on a button during http-request - consider runnable illustration http://plnkr.co/edit/a88coydvordhqv3b5ngj?p=preview angular.module('app', ['ngroute']) .controller('myctrl',['$scope', '$timeout', function($scope, $timeout){ $scope.myjson = [{title:'one'},{title:'two'},{title:'three'}]; $scope.remove = function(idx){ $scope.loading = true; $timeout(function(){ $scope.myjson.splice(idx,1); $scope.loading = false }, 700) } }]) .filter('unsafe', function($sce) { homecoming function(val) { homecoming $sce.trustashtml(val); }; }) </script> <div ng-controller="myctrl"> <div ng-repeat="j in myjson"> <a class="btn btn-default" ng-bind-html=" loading? ( '<i class=\'fa fa-refresh fa-spin\'></i>' | unsafe) : ('save...

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? - i want insert tables in infoboxes. example, have proteinbox i've developed using infobox template (http://health-and-medicine.wikia.com/wiki/template:proteinbox), , fasta field big fit comfortably in proteinbox. hence collapsible table within box. this tried: {{infobox | row 1 = {| class = "mw-collapsible mw-collapsed wikitable" |- | <!-- table content --> |} }} your problem is, putting nested table within template. pipe characters ( | ) in table syntax collides pipe usage in templates. the commonly used hack around create template called template:! , containing pipe character, , utilize when need set tables, parser functions or other stuff using pipe characters, within templates. table (with every | replaced {{!}} ): {{{!}} {{!}}- {{!}} a1 {{!}} b1 {{!}}- {{!}} a2 {{!}} b2 {{!}}} ...the equivalent of {| |- | a1 | b1 |- | a2 | b2 |} furthermore, hav...

mysql - Sql conditional Join on different tables -

mysql - Sql conditional Join on different tables - i've add together notification module on existing project. table construction on pic. picture : as see on image every notification has type , releatedid. type 1 = reservation cancelled, releated id id on "reservations" table type 3 = business relationship balance under given min. limit releatedid id on "account_movements" table what i'm trying conditional bring together avoid 2 different sql queries; get notifications belong person get notification details different tables based on "notification.type" so question can in 1 query ? something next should work. specify records in notifications table bring together records in reservations table or account_movements table when bring together in. utilize left bring together of notification records create through, , records in reservations table or account_movements have match create through. select n...

javascript - When Does Marrionette ItemView onClose method get called? -

javascript - When Does Marrionette ItemView onClose method get called? - i trying utilize onclose event clean view before removing it; although, reason never gets called. i've tried calling region.empty, region.reset, showing new view in part , destroying part , method doesn't seem called. there specific time event raised? thanks in advance. from version 2.0 current version v2.2.0 of marionette itemview 's onclose methods have changed name ondestroy . there lot of other changes , enhancements. please check documentation. javascript backbone.js marionette

Change the record color for a SELECT statement in SQL Server -

Change the record color for a SELECT statement in SQL Server - i have developed sql script manage inventory, orders , sales (invoices). have decided utilize individual select statement notify me when stock getting low. i utilize select * items quantityonhand < 2 but when displayed other select statements gets little hard distinguish if there record in there. there anyway can have results of select display reddish color? it awesome if :) thanks in advance, bryan sql-server

objective c - NSTableView doesn't display return value of objectValueForTableColumn method -

objective c - NSTableView doesn't display return value of objectValueForTableColumn method - it doesn't matter return, table view display display text manually set (the 'title' of nstextfield) in .xib file. please help me figure out i'm doing wrong. thanks. my nstableview has 1 column. here code : #import "devicesettingscontroller.h" #import <imagecapturecore/imagecapturecore.h> @interface devicesettingscontroller () @property (weak) iboutlet nstableview *tableviewscanners; @property (weak) iboutlet nsmatrix *checkboxes; @property nsmutablearray *availablescanners; @property icdevicebrowser *devicebrowser; @end @implementation devicesettingscontroller - (void)viewdidload { [super viewdidload]; _availablescanners = [[nsmutablearray alloc] init]; _devicebrowser = [[icdevicebrowser alloc] init]; _tableviewscanners.delegate = self; _tableviewscanners.datasource = self; _devicebrowser.browseddevicetypemask = icdevice...

python - Django get query value with manytomanyfield through -

python - Django get query value with manytomanyfield through - i'm new in django. practice how save info database before. don't know how query info out. please help me.thank you. here model: utilize manytomanyfiled through on movietheater. class movie(models.model): link = models.urlfield() title = models.charfield(max_length=255, null=true) title_en = models.charfield(max_length=255, null=true) class movietheater(models.model): movietheater = models.manytomanyfield(movie,null=true,blank=true,through="movieshowtime") movie_theater = models.charfield(max_length=255, null=true) class movieshowtime(models.model): theatre = models.foreignkey( movietheater, null=true,blank=true,related_name = 'theater' ) film = models.foreignkey( movie, null=true,blank=true,related_name = 'movie' ) time = models.textfield(null=true,blank=true) in views.py : from django.core.paginator import paginator, empty...

mysql - Wordpress usermeta not being created -

mysql - Wordpress usermeta not being created - i have unusual problem. when create new user in wordpress back-end, appears _usermeta info isn't beingness created in database. usually happen row gets added _users table (containing id, email, password etc...) , bunch of rows corresponding id added _usermeta table (containing name, capabilities etc...). but mentioned rows _usermeta not beingness created. some other facts: a new row user created in _users table user, doesn't appear taking next available id after latest. example, if latest id in table 1200, next user added should 1201. it's instead adding row before in table. this database exported site when on previous host (a couple of days ago), used work fine. i'm guessing happened during dump? some things have tried prepare it: disabling plugins. different theme (no functions) wordpress database repair any help appreciated. solved. reason auto increment had disappeared structure. adde...

Outlook 2013 : Add custom button to outlook mail inbox window -

Outlook 2013 : Add custom button to outlook mail inbox window - in outlook 2013, in inbox folder, have list of emails. when selecting email, previews in right side panel button of reply,reply , forwards on header of panel. i want add together custom button in header. please see reddish color highlighted box, want add together custom button. i have tries below code, add together button context menu. http://www.ecanarys.com/blog-entry/building-outlook-2010-add-using-cnet-visual-studio-2010 also, have checked below link add together custom button on different places in outlook. not find add together button on right side preview panel. add custom button in outlook please suggest. thank you, mittal. that area in outlook not customizable. outlook-addin outlook-2013

html - Why does the images not come one after another? -

html - Why does the images not come one after another? - i want have divs class image-1 inline within div having class of image-wrapper. have tried lot divs class image-1 not getting inline. may know doing mistake?? <style> *{ margin:0; padding:0; } .wrapper{ width:100%; height:400px; background-color:#666; padding:5px; box-sizing:border-box; overflow-x:hidden; } .image-wrapper{ width:300%; height:390px; background-color:#000; } .image-1{ width:100%; height:100%; background-color:#03f; float:left; display:inline-block; } </style> </head> <body> <div class="wrapper"> <div class="image-wrapper"> <div class="image-1"> </div> <div class="image-1"> </div> <div class="image-1"> </div> </div> </div> </body> 1) remove...

php - adding log in using facebook option in registration form -

php - adding log in using facebook option in registration form - i have registration form in site,where users submits personal details such name,email id,dob,and mobile number stored in database. in thought include connect facebook button,,by using link,the user can provide details logging account. details can stored in database. expectation looks image..help me implement first, need decide whether want utilize php or javascript facebook's sdk. then, download sdk from: https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.2 here's "getting started" guide php: https://developers.facebook.com/docs/php/gettingstarted/4.0.0 and here's same kind of guide javascript: https://developers.facebook.com/docs/javascript here's part of code facebook login written php. note i'm using codeigniter framwork project: public function registerwithfacebook() { seek { // proceed knowing have logged in user who...

python 3 open and read url without url name -

python 3 open and read url without url name - i have gone through relevant questions, , did not find reply one: i want open url , parse contents. when on, say, google.com, no problem. when on url not have file name, told read empty string. see code below example: import urllib.request #urls = ["http://www.google.com", "http://www.whoscored.com", "http://www.whoscored.com/livescores"] #urls = ["http://www.whoscored.com", "http://www.whoscored.com/livescores"] urls = ["http://www.whoscored.com/livescores"] print("type of urls: {0}.".format(str(type(urls)))) url in urls: print("\n\n\n\n---------------------------------------------\n\nurl is: {0}.".format(url)) sock=urllib.request.urlopen(url) print("i have sock: {0}.".format(sock)) htmlsource = sock.read() print("i read source code...") htmlsourceline = sock.readlines() sock.close() htmlsour...

statistics - Fitting the cumulative distribution function using MATLAB -

statistics - Fitting the cumulative distribution function using MATLAB - how possible create next info more fitted when plot using cumulative_distribution_function? here code, plotted using cdfplot clear all; close all; y = [23 23 23 -7.59 23 22.82 22.40 13.54 -3.97 -4.00 8.72 23 23 10.56 12.19 23 9.47 5.01 23 23 23 23 22.85 23 13.61 -0.77 -14.15 23 12.91 23 20.88 -9.42 23 -1.37 1.83 14.35 -8.30 23 15.17 23 5.01 22.28 23 21.91 21.68 -4.76 -13.50 14.35 23] cdfplot(y) there no definite reply question, broad , belongs statistics. before doing computation should reply questions: is there specific distribution type info follow? is there theoretical justification select distribution type , discard others? do need parametric or non-parametric distribution? if no specific distribution type can selected set of distributions should investigate? how compare distributions, goodness-of-fit measures? what fitting method should use, e.g. max-likelihood, method of moments...

java - Store user/pass from user created account? -

java - Store user/pass from user created account? - i'm working on blank programme allow user create business relationship can store balance , withdraw/deposit. 1 time user enters username , password, how can store info user can log in , see balance? i"m not trying create extremely secure, want able store business relationship info , able access later. this class create business relationship (still work in progress): import java.awt.flowlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.joptionpane; import javax.swing.jpasswordfield; import javax.swing.jtextfield; public class createaccount extends jframe implements actionlistener { jlabel username = new jlabel("enter username"); jtextfield enterusername = new jtextfield(null, 15); jlabel password = new jlabel("enter password"); jpasswordfiel...

javascript - jQuery doesn't locate specified anchors in bootstrap template -

javascript - jQuery doesn't locate specified anchors in bootstrap template - i using dashboard bootstrap template , want utilize jquery swap contents on click of specified links. here's code: <div class="container-fluid"> <div class="row"> <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> <li class="active"><a href="#">overview</a></li> <li><a href="#">membership requests</a> </ul> <ul class="nav nav-sidebar"> <li><a id="switch" href="http://www.google.com">list news</a></li> <li><a href="">list announcements</a></li> <li><a href="">list members</a></li> ...

rails unable to index a foreign key -

rails unable to index a foreign key - i have 2 separate migration files: class createleadprofiles < activerecord::migration def alter create_table :lead_profiles |t| t.belongs_to :contact t.timestamps end add_index :lead_profiles, :contact_id end end and: class createclientprofiles < activerecord::migration def alter create_table :client_profiles |t| t.belongs_to :contact t.belongs_to :leadprofile t.timestamps end add_index :client_profiles, :contact_id add_index :client_profiles, :lead_profile_id end end when running rake db:migrate, next error: mysql2::error: key column 'lead_profile_id' doesn't exist in table: create index `index_client_profiles_on_lead_profile_id` on `client_profiles` (`lead_profile_id`) client_profile belongs_to lead_profile, , should have lead_profile_id. , want foreign key indexed. doing wrong? try: class createclientprofiles < activerec...

javascript - Is there a way to customise Kampyle, UserVoice, GetSatisfaction or OpinionLab to display the form inline (e.g: not Lightbox)? -

javascript - Is there a way to customise Kampyle, UserVoice, GetSatisfaction or OpinionLab to display the form inline (e.g: not Lightbox)? - the part of website working on limited html files , client wants add together "was helpful - yes / no " type of feedback message @ end of every help page. i found lot of 3rd party scripts on fixed either on left hand side or on right hand side of page , input field made using lightbox. is there way utilize these scripts , add together form inline flash object or iframe embed code? ( here talking tools such us: webengage, kampyle, uservoice, getsatisfaction or opinionlab , on ). kampyle can , feedback button can customized regular html link rather floating button image. can standard (floating button) tag 'embed url' page , customize this: was helpful - <a href='https://www.kampyle.com/feedback_form/ff-feedback-form.php?site_code=<your_account_id>&amp;form_id=<your_form_id>&amp;...

linux - Why does realloc() fail where malloc() succeds in C? -

linux - Why does realloc() fail where malloc() succeds in C? - on rhel6, i'm facing unusual problem realloc(). @ point in program, realloc() returns null (the old pointer has address , there's plently of memory available). what's beingness allocated 200 construction elements (structure below). reason, when realloc() instead, works, have assign old pointer new one. below simplified version of code. this perhaps server tuning issue more programming one. opinion? thanks. //hearder file typedef struct { /* variable node detail record */ long next; long mask; char *value; // more stuff... } nodetest; extern nodetest *oldnodes; extern nodetest *newnodes; //program #define maxsize 200 // stuff oldnodes.... int alloc_nodes (void) { // allocate or grow table oldnodes = (nodetest *) malloc(maxsize * sizeof(nodetest)); if( oldnodes == null ) { //handle exception... exit(1); } //old...

ruby on rails - link_to not working and getting Page not found Only get and post requests are allowed -

ruby on rails - link_to not working and getting Page not found Only get and post requests are allowed - my route.rb: ------------ *resources :accounts, :path => "expos" resources :shows, :path => "events" resources :show_sessions, :path => "session" end end* <% @events.each |e| %> <%= link_to '<i class=icon-trash></i>'.html_safe, account_show_path(@context.id, e), :confirm => 'are sure?', :method => :delete %> <% end %> rake routes: account_shows /expos/:account_id/events(.:format) {:action=>"index", :controller=>"shows"} post /expos/:account_id/events(.:format) {:action=>"create", :controller=>"shows"} new_account_show /expos/:account_id/events/new(.:format) {:action=>"new", :controller=>"shows"} edit_account_show /expos/:account_i...

Laravel Form Submit Redirect to "Whoops, looks like something went wrong." -

Laravel Form Submit Redirect to "Whoops, looks like something went wrong." - i have tried develop login form using laravel. when submit redirect "whoops, looks went wrong." url: lav.local after form submit: lav.local/login ---> error but if press come in button "lav.local/login" redirect login form, why doesn't work when submit button/post data. login.blade.php {{ form::open(array('url'=>'login')) }} {{ form::label('email', 'email') }} {{ form::text('email', '', array('placeholder'=>'email')) }} <br/> {{ form::label('password', 'password') }} {{ form::password('password', array('placeholder'=>'password')) }} <br/> {{ form::submit('login', array('class'=>'btn btn-success')) }} {{ form::close() }} homecontroller public function getindex() { homecoming view::make('home....

sql server - Inputfile for sqlplus -

sql server - Inputfile for sqlplus - i have problems sqlplus , oracle. have piece of code open sqlcmd , give inputfile on parameter -i sql-statements need. before open cmd-window java , on cmd-window open sqlcmd. sounds not smart, couldnt figure out how start sqlcmd straight parameters below without using cmd-window. the phone call of sqlcmd looks this: sqlcmd -s [servername] -i input_file the input file contains basic sql-statements usual select, from, clause. works great , job, need translate oracle-database. my question here: there similar parameter -i sqlplus oracle database? sqlplus usr/password@database_name thats how far , wondering if can extend line, can read in input file sql-statements. thanks in advance you can execute sql*plus script on command line prefixing @ sign sqlplus username/password@tns_alias @your_script_here.sql sql-server oracle sqlplus

Given a month perl should split into weeks -

Given a month perl should split into weeks - i trying split month 4 weeks using perl.say eg. input giving start date , end date. start date-09/01/2014 end date-09/30/2014 perl should split date range 4 different weeks.do have thought how proceed that. thanks in advance.. 4 weeks lasts 28 days. you've prefaced problem 30 day period. assuming want week stand sunday - saturday, next code using time::piece of assistance you: use strict; utilize warnings; utilize time::piece; utilize time::seconds; $start = '09/01/2014'; $end = '09/30/2014'; $fmt = '%m/%d/%y'; # normalized noon avoid dst $week_start = time::piece->strptime( $start, $fmt ) + 12 * one_hour; $month_end = time::piece->strptime( $end, $fmt ); while (1) { print $week_start->strftime($fmt), ' - '; $week_end = $week_start + one_day * ( 6 - $week_start->day_of_week ); if ( $week_end > $month_end ) { print $end, "\n...

Awk - Multiline matching, printing filename and match -

Awk - Multiline matching, printing filename and match - i have next awk command: awk -v rs=! -v ors= '/abc/ && /def/ {print filename;}' files this looks in each file in files, separates each record in file '!', , matches record 'abc' , 'def'. above code print name of file. if remove {print filename} print whole record if matched. a file like: abc1 bce bcd def ! abc2 bce def ! i want print out filename , line matches 'abc'. example: file1 abc1 file2 abc2 abc3 how can go this? awk 'fnr==1{print filename} /abc/' file1 file2 the fnr field set 1 new file read. fnr==1 true, @ first line of each input file, action performed print filename print file1 , file2 /abc/ match lines containing abc since no action specified, default beingness print entire record ( $0 ) performed. similar writing /abc/{print $0} file1 abc1 file2 abc2 abc3 awk

html - How to exempt an element from a keyframes animation? -

html - How to exempt an element from a keyframes animation? - i using keyframe fade <nav> in. want 1 li not fade in. know how? first here css: nav{ -webkit-animation: fadein 0.5s; -moz-animation: fadein 0.5s; -ms-animation: fadein 0.5s; -o-animation: fadein 0.5s; animation: fadein 0.5s; } @keyframes fadein { { opacity: 0; } { opacity: 1; } } @-moz-keyframes fadein { { opacity: 0; } { opacity: 1; } } @-webkit-keyframes fadein { { opacity: 0; } { opacity: 1; } } @-ms-keyframes fadein { { opacity: 0; } { opacity: 1; } } @-o-keyframes fadein { { opacity: 0; } { opacity: 1; } } and here html: <nav id="nav"> <ul> <li id="menuicon"> <img src="menuicon.svg" alt="q" onclick="showmenu()"> </li> <li id="aboutlist"> <a href="#about"> </a> </li> ...