Posts

Showing posts from August, 2015

java - Why can't I use Valid parameter along with RequestParam in Spring MVC? -

java - Why can't I use Valid parameter along with RequestParam in Spring MVC? - example: public string getstudentresult(@requestparam(value = "regno", required = true) string regno, modelmap model){ how can utilize @valid regno parameter here? @valid can used validate beans. have'nt seen used on single string parameters. requires validator configured. the @valid annotation part of standard jsr-303 bean validation api, , not spring-specific construct. spring mvc validate @valid object after binding so-long appropriate validator has been configured. reference : http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html java spring spring-mvc java-ee annotations

if statement - Bash Script - Not returning column/variable -

if statement - Bash Script - Not returning column/variable - i having issue cant seem figure out after couple hours of tinkering this. cant seem script homecoming final column. #!/bin/bash file="/users/user12/desktop/url-list.txt" log="/users/user12/desktop/url-results.txt" fmt="%-25s%-12s%-16s%-20s\n" printf "$fmt" domain_name http_code response_time content_check > "$log" while read line read code time < <(curl -o /dev/null --silent --head --write-out '%{http_code} %{time_total}' "$line") curl "$line" 2>/dev/null > /users/user12/desktop/domainquerystring_output.txt ifstatementconditional=`grep "the content i'm looking verify" /users/user12/desktop/domainquerystring_output.txt | wc -l` if [ $ifstatementconditional -eq 1 ] ; second_check="online" else second_check="domain offline" fi printf "$f...

solr4 - How add less than and greater than in data-config file of solr -

solr4 - How add less than and greater than in data-config file of solr - this how goes have 2 tables businessmasters business_id business_point 1 3.4 2 2.8 3 8.0 business_colors business_colors_id business_rating_from business_rating_to rating 1 2 5 ok 2 5 10 3 10 15 first-class i want link 2 tables based business_rating_from , business_rating_to like select business_colors_id,business_rating_from,business_rating_to,rating business_rating_from >= 2 , business_rating_to < 5; now want index them solr.this how data-config file looks <entity name="business_colors" query="select business_colors_id, business_rating_from,business_rating_to,bus...

java - Big O notation (Complexity) -

java - Big O notation (Complexity) - what big o of loop? -> understand loop going execute n times. task within of loop executes n times right? create o(n^2) or not combine them , simple o(n)? think o(n) because how many times loop executing clarification why or why not be? explanations helpful prepare midterm. for(int = 0; < a.length;i++){ a[i] = b[i] } think how many times code within loop executes. each a[i] = b[i] happens a.length times, phone call n . o(n) . java big-o complexity-theory

Calculating Prime Numbers in MIPS Assembly -

Calculating Prime Numbers in MIPS Assembly - i working on programme calculates prime numbers 200 using recursion in mips assembly using pcspim. far, have populated array of numbers 1-200 , binary vector list consists of 1's successfully. concept struggling how utilize stack frame help process. here have stack frame: subu $sp,$sp,32 # set stack frame sw $ra, 28($sp) # save $ra register stack sw $fp, 24($sp) # save $fp register stack addu $fp, $sp, 28 # set $fp register end of stack i don't understand how going help me find prime numbers. insight appreciated! if you're familiar sieve of eratosthenes, don't need recursion find prime numbers. method much simpler , more memory-efficient using recursion, , don't need utilize stack. i can't help "how going help me find prime numbers", because never specified algorithm you're using. assembly mips pcspim

ios - Extract and Convert NSData from BLE to Float in Swift -

ios - Extract and Convert NSData from BLE to Float in Swift - i'm developing ios app handles bluetooth sensortag. sensortag based on ti ble sensortag, had of sensors removed. in sourcecode of original ios app ti xyz-values calculated follows kxtj9_range defined 1.0 in implementation , kxtj9 accelerometer built on sensortag +(float) calcxvalue:(nsdata *)data { char scratchval[data.length]; [data getbytes:&scratchval length:3]; homecoming ((scratchval[0] * 1.0) / (64 / kxtj9_range)); } the info comes hexadecimal "fe850d" , method cutting in 3 parts. i'm trying convert method swift, wrong numbers back e.g. fe should homecoming around 0.02 objective c code does my swift code far class sensor: nsobject { allow range: float = 1.0 var data: nsdata var bytes: [byte] = [0x00, 0x00, 0x00] init(data: nsdata) { self.data = info data.getbytes(&bytes, length: data.length) } func calcxvalue()->float { homecomi...

php - While loop is repeating other elements in the page -

php - While loop is repeating other elements in the page - hello have query while loop used retrieving info in here query along while loop in top of page repeating other elements header. here code: <?php require_once('../admin panel/db.php'); if(!empty($_post['province']) && !empty($_post['district']) && !empty($_post['radio'])) { $provincename=$_post['province']; $districtname=$_post['district']; $propertystatus=$_post['radio']; $query = "select properties.propertyid, properties.propertytype, properties.propertydealtype, properties.propertyregion, properties.propostedprice, properties.dealstatus, properties.currencytype, propertyimages.imageid, propertyimages.imagepath, propertyimages.imagename, provinces.provincename, districts.districtname, pds.pdname properties, provinces, districts, pds, propertyi...

Go unmarshal xml into struct -

Go unmarshal xml into struct - i have xml file , seems cant unmarshal info struct. can help me out here. never used xml before, prefered json before xml. edited post code , still gives me empty struct values <envelope> <data> <order> <deliverydata> <del_country>belgique/belgie</del_country> <del_country_code>be</del_country_code> <del_company>false</del_company> <del_name>adam</del_name> <del_contact></del_contact> <del_firstname></del_firstname> <del_addressline1>durasweg 33</del_addressline1> <del_addressline2></del_addressline2> <del_areacode>1000</del_areacode> <del_city>bruxelles</del_city> <del_country>be</del_country> ...

https - I would like to know the difference between GoodData project specific and user data storages, and their volatility and persistency -

https - I would like to know the difference between GoodData project specific and user data storages, and their volatility and persistency - i know difference between gooddata project specific info storage , user specific info storage. know volatility , persistency. you can read on project specific , user specific info storage on our developer portal here: project specific: https://developer.gooddata.com/article/project-specific-storage user specific: https://developer.gooddata.com/article/user-specific-storage note:we preserve info 1 day on user stagging , 14 days on project stagging. honza https storage webdav gooddata

python - seaborn kdeplot bandwith error? -

python - seaborn kdeplot bandwith error? - i testing seaborn bundle python. in particular using kdeplot method plotting bivariate distribution. issue comes when seek specify constant bandwidth (bw) data. think fit bw using "scott rule". using next line: sns.kdeplot(x,y, bw=1, ...) however, returns next error: unboundlocalerror: local variable 'bw_x' referenced before assignment any thought what's going on here? thanks. python seaborn

c# - Content Page does not have content of Master Page -

c# - Content Page does not have content of Master Page - master page content : <form id="form1" runat="server"> <div> <asp:contentplaceholder id="contentplaceholder1" runat="server"> <center> <table border="0" cellspacing="0" style="border-collapse: collapse; border-top-width:0" bordercolor="red" width="970" bgcolor="#dde1ee" cellpadding="0"> //all contents </table> </center> </asp:contentplaceholder> </div> </form> content page: <%@ page title="" language="c#" masterpagefile="~/cambridgemaster.master" autoeventwireup="true" codefile="home.aspx.cs" inherits="home" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> </asp:content> <asp:conte...

Is there a Form Builder for Java/Spring web apps? -

Is there a Form Builder for Java/Spring web apps? - i'm migrating php java , spring . noticed spring , if it's great framework, misses things bundled in other frameworks on other platforms. 1 miss ability build form using dedicated builders, without writing single line of html . let's take symfony2 illustration (click here total article): /** * controller class */ public function newaction(request $request) { // create task , give dummy info illustration $task = new task(); $task->settask('write blog post'); $task->setduedate(new \datetime('tomorrow')); $form = $this->createformbuilder($task) ->add('task', 'text') ->add('duedate', 'date') ->add('save', 'submit', array('label' => 'create post')) ->getform(); homecoming $this->render('acmetaskbundle:default:new.html.twig', array( ...

python - wifijammer.py issue MacOSx -

python - wifijammer.py issue MacOSx - i'm trying test out https://github.com/danmcinerney/wifijammer error traceback (most recent phone call last): file "wifijammer.py", line 371, in <module> mon_iface = get_mon_iface(args) file "wifijammer.py", line 52, in get_mon_iface monitors, interfaces = iwconfig() file "wifijammer.py", line 69, in iwconfig proc = popen(['iwconfig'], stdout=pipe, stderr=dn) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child raise child_exception oserror: [errno 2] no such file or directory i realize maybe because macosx not have iwconfig.....but if indeed issue there work around? source modification can create error doesn't occur? wifijammer....

javascript - Resolve services in app.run, bad logic? -

javascript - Resolve services in app.run, bad logic? - i discovered issue doing service calls in .run method. seems controllers doesn't wait services resolve before moving on .run(['user', 'translation', function(user, translation) ... service injection get user: $rootscope.user = user.get(); get translation based on users preferred language $rootscope.user.$promise.then(function(user) { $rootscope.translation = translation.language(user.user_language.tolowercase()).then(function(translation) { $rootscope.translation = translation.data; }); intercom , other stuff... }); in controller set property on object translation like $scope.obj = { prop: $scope.translation.prop } this fails 10% of times, i'm guessing, due fact language services hasn't been resolved yet. all initialization of stuff intercom, segment.io based on info user, thats tried language resolved in .run the question should instead. seems repet...

java - Performance of Apache Math library version 3.3 vs 2.2 -

java - Performance of Apache Math library version 3.3 vs 2.2 - i have code physics modelling , uses apache math library version 2.2. math library version 3.3 has superseded ver 2.2 3 years now, , wanting upgrade library. however, testing showed new library create model take 20% longer run. much of model run-time spent doing math.exp() functions, , utilize fastmath.exp() possible much faster. however, fastmath.exp() appears 20% slower in apache math3. this real shame, apache math3 includes erf.erfinv() mean don't have utilize separate library error functions. however, cant afford lose 20% speed. utilize of unchecked exceptions in math3 nice too, can simulate catching checked exceptions v2 , re-throwing unchecked. does know why math3 slower in these places? does have pressing reason why should upgrade despite performance impact? if not, wont upgrading math3 :-/ java performance apache-commons-math

c++ - Saving frames as images using FFmpeg -

c++ - Saving frames as images using FFmpeg - there tutorials on net it, of them using deprecated functions , unfortunately api utilize broke , makes mess , i'm confused. i'm next tutorials, learning documentation , seeing examples of current version (even way examples not work). what i'm trying save frames in .png , next examples , reading did this, i'm confused conversion frame rbg , saving it: #include <iostream> extern "c" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libavutil/avutil.h> } int main(int argc, char ** argv) { if (argc < 2) { av_log(0, av_log_fatal, "usage: %s <input>", argv[0]); homecoming -1; } const char * filename = argv[1]; // register codecs , formats av_register_all(); // open input file, , allocate format context avformatcontext *avformatcontext = avformat_alloc_context(); if ...

ios - Retrieve images from parse before UITableVIew has loaded? -

ios - Retrieve images from parse before UITableVIew has loaded? - everything works fine except images in cell showing after disturbing delay. 0,3 seconds after tableview has finished loading. think it's pretty ugly show blank image short time... how can create tableview show after images parse loaded (why not cache first?). or maybe create launch screen hold on longer time..? tableview initial view in app. queryfortable - (pfquery *)queryfortable { pfquery *query = [pfquery querywithclassname:self.parseclassname]; // if no objects loaded in memory, cache // first fill table , subsequently query // against network. if ([self.objects count] == 0) { query.cachepolicy = kpfcachepolicycachethennetwork; } [query orderbyascending:@"name"]; homecoming query; } cellforrowatindexpath - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath object:(pfobject *)objects { ...

c# - Why should I remove the form tag from the master page when using bootstrap & ASP.Net webformds -

c# - Why should I remove the form tag from the master page when using bootstrap & ASP.Net webformds - in couple tutorials have been suggested on site on integrating bootstrap asp.net web forms, suggest form tag removed master page. here 1 tutorial leave in form tag: on asp.net site describes master pages, mentions why there form tag in master page: a web form (the <form runat="server"> ) - because asp.net pages typically have web form - , because master page may include web controls must appear within web form - sure add together web form master page (rather adding web form each content page). a lot of asp controls utilize in master page , content pages require parent form tag, hence cumbersome remove parent form tag on master page. why necessary remove form tag master page when adding bootstrap site? bootstrap not work when within of form tag? bootstrap works fine form tag in master page. maintain in mind going have tweak/override sty...

Fusion Tables 500 response on csv import to private table -

Fusion Tables 500 response on csv import to private table - since mon android app users have been getting 500 homecoming code fusion tables whenever seek save data. within app convert geo info csv format , post fusion tables using insert command. before sunday appears have been working fine. starting on mon seeing problems the next logcat 100% of our saves: 10-29 12:18:34.083: w/system.err(3650): java.io.filenotfoundexception: https://www.googleapis.com/upload/fusiontables/v1/tables/[valid table id redacted]/import?access_token=[valid access token redacted] despite error message, manually checking fusion tables shows no error , seems fine. given other problems drive on mon i'm guessing team rolled out changes on weekend. perhaps there alter means need terminate stream special character or something. else experiencing similar problem or have thought going on? i'm 30 complaints users , it's getting bit old. we believe resolved -- still ge...

javascript - Google Maps add Info Window on Map Click -

javascript - Google Maps add Info Window on Map Click - i've been having issues trying display info window when click anywhere on google maps. when click anywhere on map display marker , info window showing latitude , longitude? how can done? this code have far: <script type="text/javascript"> var locations = <?php echo json_encode($js_array);?>; var lats = <?php echo json_encode($lats);?>; var lats = <?php echo json_encode($iphoto);?>; var map = new google.maps.map(document.getelementbyid('map'), { zoom: 10, center: new google.maps.latlng(<?php echo $latitude;?>, <?php echo $longitude;?>), maptypeid: google.maps.maptypeid.roadmap }); var infowindow = new google.maps.infowindow(); var marker, i; var latlngbound = new google.maps.latlngbounds(); (i = 0; < locations.length; i++) { console.log(locations[i].lat); // create latlng object ,...

Ruby file won't run in Max OSX Terminal. syntax error, unexpected end-of-input, expecting keyword_end -

Ruby file won't run in Max OSX Terminal. syntax error, unexpected end-of-input, expecting keyword_end - using: rvm 1.26.0 ruby 2.1.4 osx mavericks 10.9.5 textedit terminal i'm working on larn code ruby hard way tutorial. first program. puts "hello world!" puts "hello again" puts "i typing this." puts "this fun." puts "yay! printing." puts "i'd must rather 'not'." puts 'i "said" not touch this.' this comes in terminal. ex1.rb:7: syntax error, unexpected end-of-input, expecting keyword_end puts 'i "said" not touch this." i have nitrious.io business relationship , file runs on it. have searched answer, of other questions involve more complicated programs solutions don't seem apply simple this. understanding terminal should print these no issues. help appreciated! if re-create pasted code exactly, issue quotes. need standard " inste...

c++ - trouble converting void * back to struct -

c++ - trouble converting void * back to struct - i'm working on game using box2d physics , having problem void *. box2d fixtures have (void*) userdata field, doors in level, setting address of door information, struct called nextlevel (below). struct newlevel { bool changed; std::string name; int x; int y; int posx; int posy; int num; }; the doors stored in level class in std::vector<newlevel> doors . in loop assembles each of levels, if there door, doors.push_back(newlevel()) , set info accordingly. store fixturedef.userdata = &doors.back() . however, when go retrieve information, doesn't work out. (fixb beingness pointer fixture in contact). newlevel nextdoor = *(static_cast<newlevel*>(fixb->getuserdata())) sometimes, works. however, @ other times, gives gibberish. when load next level, clear vector. print pointers out lot, sometimes, don't match, cause this? there improve way pass data? thanks! (i...

php - Registration process NOT inserting into database -

php - Registration process NOT inserting into database - my register.inc.php not inserting user info database. redirects me register_success.php . have missed in adding inserted data? register.inc.php: include_once 'config.php'; include_once 'db_connect.php'; $error_msg = ""; if (isset($_post['username'], $_post['firstname'], $_post['lastname'], $_post['home_address1'], $_post['home_address2'], $_post['home_city'], $_post['home_state'], $_post['home_zipcode'], $_post['email'], $_post['p'])) { // sanitize , validate info passed in $username = filter_input(input_post, 'username', filter_sanitize_string); $firstname = filter_input(input_post, 'firstname', filter_sanitize_strings); $lastname = filter_input(input_post, 'lastname', filter_sanitize_strings); $home_address1 = f...

python - How to efficiently animate a Graphviz graph? -

python - How to efficiently animate a Graphviz graph? - i animate graphviz generated graph, changing node labels , node , border colors. i creating graphs using python interface graphviz. way seems to create every image independently (although changes between frames small) , bring together images animation, explained here. is there more efficient way create animation, avoiding creation of these images independently? python animation graph graphviz

arrays - Trouble Writing to file -

arrays - Trouble Writing to file - i'm having problem finishing off model. concept questions asked range of turtles. each turtle represents single domain of knowledge , each question should contain multiple random domains of knowledge. turtles id matches 1 of domains in question asked answer. reply rated based on turtle's abilities , expertise. i hoping have bones of code i'm unable verify until can output excel. can tell me i'm going wrong 'write' instructions? when run model, no file updated or created. , can spot other defects in code? thanks, john globals [question answer] turtles-own [abilities expertise expert ] setup clear-all file-open "/users/johnhayes/projectfile.csv" create-turtles 500 set question [] set reply [] reset-ticks end go inquire turtles [initialise-turtles] create-question set reply [] inquire turtles [give-an-answer] evaluate show (list "relevance quality" answer) stop tick if ticks >...

excel - How to get a shell scripted change to be recognised by an open application -

excel - How to get a shell scripted change to be recognised by an open application - i have particular problem because of bug affecting date formatting in vba/excel 2011 mac osx 10.10 . i have found can work around bug changing part setting - in systempreferences / language & region - non-gmt locale. instance, if alter part united kingdom italy , bug doesn't occur. i've been developing macro runs applescript , in turn runs shell script, alter setting using defaults utility. shell script i'm using this: defaults write nsglobaldomain applelocale en_gb the intention beingness on opening excel, the value of applelocale changed, bug gone , then, on closing, value of applelocale reverted previously. changing setting of applelocale programmatically on opening excel works fine. excel picks alter if restart application. however, if create alter part setting using scheme preferences gui, don't need restart excel recognise change. i want avoi...

ruby on rails - RoR- erb file added text is Garbled -

ruby on rails - RoR- erb file added text is Garbled - i added text "hello world" in erb file , ran it. garbled in front end of text. thanks help!! you trying save erb file rich text format file. seek saving "plain text" file. ruby-on-rails

asp.net - Bootstrap navbar collapse not formatting correctly -

asp.net - Bootstrap navbar collapse not formatting correctly - below markup bootstrap navbar - generated code-behind via database - problem right aligned items beingness pushed under rest of menu items until browser width less left aligned items, acts normally. any ideas did wrong? thanks markup <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="./" class="navbar-brand">application name</a> </div> ...

c# - DateTimePicker + WPF + binding + accept dd/MM/yyyy via userinput -

c# - DateTimePicker + WPF + binding + accept dd/MM/yyyy via userinput - simplified question: i have datepicker in wpf. come in value 30/10/1983 in textbox of datepicker. need value posted viewmodel, in have bound datetime? property. is there way can accomplish this. mm/dd/yyyy format triggers postback not dd/mm/yyyy. the datepicker code below. <datepicker grid.row="2" name="inputdate" text="{binding birthdate,mode=twoway,updatesourcetrigger=propertychanged}" > </datepicker> the view model property below. private datetime? birthdate; public datetime? birthdate { { homecoming this.birthdate; } set { this.birthdate = value; onpropertychanged("birthdate"); } } i come in value 10/10 datepicker textbox, setter gets called value, moment come in entire date 30/10/1983, still have view mo...

c# - Could someone explain how this ignore route works? -

c# - Could someone explain how this ignore route works? - so added asmx web service mvc4 when tried access got "the resource not found" error. after searching found answer here. in short, had add together next ignoreroute routeconfig file. routes.ignoreroute("{*x}", new { x = @".*\.asmx(/.*)?" }); i understand maproute function in mvc well, ignoreroute, not much. understand it's targeting .asmx postfix i'm not sure on how's , why's of quick fix. how ignoreroute work, , why create mvc app magically understand how find , execute web service? btw, mapped route, currently, default, there another/better way of solving issue using maproute or fix? ignore route indicates routing should ignore these requests , asp.net processing of these requests occur. http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx/ c# asp.net-mvc-4 ignoreroute

javascript - workaround of Chrome 37+ modal dialog returnValue -

javascript - workaround of Chrome 37+ modal dialog returnValue - i have parent caller page , modal page, when modal page closed, caller page gets returnvalue popup modal page. older version chrome's showmodaldialog() returns undefined, there many workarounds [javascript - showmodaldialog not returning value in chrome. but window.showmodaldialog() in chrome37+ deprecated design [http://blog.chromium.org/2014/07/disabling-showmodaldialog.html], workarounds returnvalue of popup window not work anymore. than tried window.open() , window.open deed quite differently showmodaldialog , , not easy right returnvalue (since window.open() asynchronous). so there perfect way solve this? you can utilize jquery modal dialog framework jquery modal dialog example $( ".selector" ).dialog({ close: function( event, ui ) { alert('dialog closed'); return; } }); or fancybox framework fancybox example $(".fancybox").f...

finding timestamp difference for a day in R -

finding timestamp difference for a day in R - i have info in interval of 15 minutes , need find time difference between next record , current record using r not able do. can help here? timestamp id timediff 07/29/2014 10:15 189252 0:15 07/29/2014 10:45 189252 0:30 07/29/2014 11:00 189252 0:15 07/29/2014 11:15 189252 0:15 07/29/2014 11:30 189252 0:15 07/29/2014 11:45 189252 0:15 07/29/2014 12:00 pm 189252 0:15 07/29/2014 12:15 pm 189252 0:15 07/29/2014 12:30 pm 189252 0:15 07/29/2014 01:00 pm 189252 0:30 07/29/2014 01:15 pm 189252 0:15 07/29/2014 01:30 pm 189252 0:15 07/29/2014 01:45 pm 189252 0:15 this straightforward long info in appropriate date-time format: > foo <- as.posixct(c("07/29/2014 10:15","07/29/2014 10:45"), format="%m/%d/%y %h:%m") > foo [1] "2014-07-29 10:15:00 cest" "2014-07-29 10:45:00 cest" > diff(foo) time difference of 30 mins look @ ?as.posixct , ?st...

node.js - express.js: how to download stream as a file? -

node.js - express.js: how to download stream as a file? - my story follows: user uploads txt file express.js server, text file transformed pdf file; pdf file can streamed browser via request.pipe. can stream on user side, how allow browser download stream pdf file? if have pdf readable stream, can like: res.attachment('pdfname.pdf'); pdfstream.pipe(res); or if have pdf on disk, can send client with: res.download('/path/to/file.pdf'); or specify custom filename that's presented browser: res.download('/path/to/file.pdf', 'pdfname.pdf'); node.js express

ios - Compiler errors on Xcode 6 -

ios - Compiler errors on Xcode 6 - i updated xcode 6 while ago, had absolutely no errors on xcode 5.1.1 getting weird , totally illogical errors when compiling in xcode 6. went through of them have no thought why these errors appearing on xcode 6. https://www.dropbox.com/s/z255siefabr8xtv/screenshot%202014-10-04%2009.56.35.png https://www.dropbox.com/s/19hcoi4068semuo/screenshot%202014-10-04%2009.56.50.png all these errors on dependency pods , methods i've used in native code. none of these errors occurring in code except external library methods beingness called within code yes, errors related compatibility. on terminal, within project directory - did rm -rf ~/.cocoapods followed by, sudo gem install cocoapods on terminal. and now, before pod install . modify podfile. instead of version, can specify :head flag. utilize pod’s latest version spec version, forcefulness download of ‘bleeding edge’ version [source]. spec might not compatible source material a...

c# - LINQ orderby and group -

c# - LINQ orderby and group - consider next code var res = d in calentries grouping d d.date.tostring("mmmm") grp orderby grp.key select grp; i have list of objects in calentries 1 fellow member property date of type datetime . code returns me dates grouped month name order of groups alphabetic nov appear before oct example. how can modify query retain grouping on month name order groups based on months chronological order? it backwards grouping name of month if don't care month name @ all. instead, grouping straight month number , sort it. don't compute strings if native format of info more suitable. group x x.month g orderby g.key select new { monthname = g.key.tostring("mmmm"), items = g.tolist() } c# linq

Not able to connect to mysql via php script , but can login to phpmyadmin in LAMP UBUNTU -

Not able to connect to mysql via php script , but can login to phpmyadmin in LAMP UBUNTU - i trying connect mysql using php in ubuntu lamp. can login phpmyadmin , not able connect using php code. code working in xampp . i using next code $con=mysql_connect("127.0.0.1","myusername","mypassword"); if (!$con) { die('could not connect: ' . mysql_error()); } but shows next error could not connect: access denied user 'root'@'localhost' (using password: yes) there 3 (that know of) posible solutions depending on problem. there firewall in ubuntu need open, granting access in iptables. /sbin/iptables -a input -i eth0 -p tcp --destination-port 3306 -j take , should able login our server our local machine: mysql -h255.112.324.12 -uroot -pmypassword you need grant access mysql: http://askubuntu.com/questions/159053/mysql-server-not-accessible-from-remote-machine as root, open /e...

Installing UVM 1.2 in Questasim 10.2 windows -

Installing UVM 1.2 in Questasim 10.2 windows - i have downloaded uvm 1.2 accellera website. using questasim 10.2 , uvm version 1.1d. now copied uvm 1.2 folder c:\questasim_10.2c . changed mtiuvm = $model_tech/../uvm-1.1d line in modelsim.ini to mtiuvm = $model_tech/../uvm-1.2 but questasim showing error library cannot found. how solve issue , install uvm 1.2 in questasim? mtiuvm different thing. mentor graphics version of uvm additions back upwards transaction recording in questa (and maybe other stuff). you don't install uvm, compile normal package: vlog +incdir+<oath_to_uvm>/sv <oath_to_uvm>/sv/uvm_pkg.sv this way uvm ends in same work library you're compiling other packages. uvm questasim

parse.com - Javascript - Delete duplicates in class -

parse.com - Javascript - Delete duplicates in class - i have class in parse called testitem here snap shot of class so trying write code function remove this. there not more duplicates. have tried parse.cloud.job("removeduplicateitems", function(request, response) { function checkduplicate(school) { var testitem = parse.object.extend("testitem"); var testitemsquery = new parse.query(testitem); testitemsquery.equalto('school', schoolarray[i]); testitemsquery.each(function(testitem) { var item = testitem.get('item'); var school = testitem.get('school'); var dininghallnum = testitem.get('dininghallnumber'); var testitemsquerycheck = new parse.query(testitem); testitemsquerycheck.equalto ('item', item); testitemsquerycheck.equalto ('school', school); testitemsquerycheck.equalto ('dininghallnumber', dininghallnum); //the...

java - Mock Files with PowerMockito -

java - Mock Files with PowerMockito - i have next test code: @runwith(powermockrunner.class) @preparefortest({logger.class, files.class}) public class testclass { private static final list<string> list = new arraylist<string>() {{ add("some entry"); }}; private static final path path = paths.get("/tmp/foo"); @before public void setup() { powermockito.spy(files.class); powermockito.doreturn(list).when(files.class, "readalllines", path, charset.defaultcharset()); } @test public void test() {} } the code above throws "nosuchfileexception" on lastly line. here stacktrace: java.nio.file.nosuchfileexception: /tmp/foo @ sun.nio.fs.unixexception.translatetoioexception(unixexception.java:86) @ sun.nio.fs.unixexception.rethrowasioexception(unixexception.java:102) @ sun.nio.fs.unixexception.rethrowasioexception(unixexception.java:107) @ sun.nio.fs.unixfilesystemprovider.newby...

Repeat one column values by another column values in R data frame -

Repeat one column values by another column values in R data frame - this question has reply here: r: how split string on column , move each substring next line? 3 answers splitting string new rows in r 3 answers i have next info frame: v1 v2 1 a,b,a 2 a,c 3 b,b 4 a,c,b,c how can utilize have next info frame? v1 v2 1 1 b 1 2 2 c 3 b 3 b 4 4 c 4 b 4 c try csplit library(data.table) library(devtools) source_gist(11380733) ## csplit(df, 'v2', ",", 'long') # v1 v2 #1: 1 #2: 1 b #3: 1 #4: 2 #5: 2 c #6: 3 b #7: 3 b #8: 4 #9: 4 c #10: 4 b #11: 4 c r

php - INSERT INTO sql query is using variable string rather than field name -

php - INSERT INTO sql query is using variable string rather than field name - getting confused surrounding insert into. should insert 3 fields table, userid , activatekey , isactivated . the activatekey 25 letter randomly generated key such 63n20kw24ba1mlox34e8n2awv the userid comes table , set auto_increment. the isactivated 0 @ stage. it seems quite simple insert statement if (!mysqli_query($con,"insert activations (userid,activationkey,isactivated) values (".$userid.",".$activatekey.",'0')")) { echo("error description: " . mysqli_error($con)); } however doesn't work when include $activatekey field. seek search string variable $activatekey column name. error is: error description: unknown column '63n20kw24ba1mlox34e8n2awv' in 'field list' of course of study there no such column 63n20kw24ba1mlox34e8n2awv , info i'm trying insert, hence why it's in values section. ideas ...

itextpdf - Rupee symbol is not showing in android -

itextpdf - Rupee symbol is not showing in android - hi friends using itextpdf-5.3.4.jar creating pdf. showing rupee symbol using custom font .i tried arial.ttf,arialbd.ttf both these font no luck rupee sybol not showing.for showing rupee symbol have followed these links not working me. how display indian rupee symbol in itext pdf in mvc3. code have used. basefont rupee =basefont.createfont( "assets/arial .ttf", basefont.identity_h,basefont.embedded); createheadings(cb,495,60,": " +edt_total.gettext().tostring(),12,rupee); private void createheadings(pdfcontentbyte cb, float x, float y, string text, int size,basefont fb){ cb.begintext(); cb.setfontandsize(fb, size); cb.settextmatrix(x,y); cb.showtext(text.trim()); cb.endtext(); } please help me guys. in comment section, funkystein wrote problem describe typical when you using font doesn't have glyph. or you aren't using right encoding. i have written illust...