Posts

Showing posts from April, 2011

c - installing qt4-make on ubuntu 12.04 LTS -

i running ubuntu 12.0.4 lts on controller. trying install qt4-make using apt-get, getting message package not found. need make , compile file. how can install ? also, there alternative can download ? tried sudo apt-get install libqt4-* . still nothing happens. i think qt4-make qmake, try this: sudo apt-get install qt4-qmake

ios9 - iOS 9 Xcode 7 - Application appears with black bars on top and bottom -

Image
installed app on iphone 6 ios9 , here happened. notice black bars on top , bottom. works fine on ios8. how can fix it? i've tried building xcode 6.4 & 7. same result. (iphone 5 used run iphone 4 apps this) did migrate app earlier version of xcode? if xcode making assumption screen size , need way of indicating actual screen size @ run time. there 2 ways: a) if use launch screen. you missing launchscreen.storyboard file. create launchscreen.storyboard file , add project. b) if don't use launch screen. go target's settings , choose general, app icons , launch images. set "launch screen file" "main.storyboard" (or storyboard if appropriate)

owl - Why Jena is not returning declared RDFS properties? -

i use jena's ontclass.listdeclaredproperies() functions. every class supposed have rdfs properties (e.g. rdfs:comment), listdeclaredproperies never returns of them. how associated class , how them? update 1 i thought ontology classes have automatically declared rdfs properties. in documentation of rdfs properties written comment property "the rdfs:domain of rdfs:comment rdfs:resource". because ontology classes rdfs:resource thought should have rdfs:comment property automatically , should (together other rdfs properties) calling listdeclaredproperies function (this function returns properties of superclasses) i'm missing rdfs properties... example so when call listdeclaredproperies @ class (anyclass.listdeclaredproperies()), rdfs properties listed "normal" properties. why doesn't work? can add value of rdfs properties class or individual (e.g. label, comment etc.) explanation.

html - PHP return partial script -

i creating php (let's call pagex.php) file produces html. html has button when press it, send ajax request. to avoid having multiple files, want send ajax request same file. (pagex.php) i don't want ajax response return entire php generated response have normal request pagex.php. looking php method stop executing , return has. i understand can big if statement, don't wrapping bottom part of code braces. looking equivelent of "break" statement php return current php generated html. is possible? send ajax request pagex.php?ajax=y can <?php if(!empty($_get['ajax'])) { //return ajax data exit; } ?> //your normal html code here

security - Is it safe to type password when scripting commands via ssh? -

i've seen handy command query distant database local machine: ssh user@server 'mysql -uimauser -ppassword imadb -e "select * table"' but wonder how safe is? can capture password? if how? i'm aware works too: ssh user@server 'mysql -uimauser -p imadb -e "select * table"' but automation purpose, prefer first solution (if safe of course). i've tried capture password ps didn't see (my knowledge of ps poor).

Grade Calculator JavaScript not running -

i attempted create grade calculator value of grades in javascript. no parts of code executed when code run. there blatant error in code's syntax? thanks, ben var numberofgrades = prompt("how many grades want calculate?"); var countingvalue = 1; var grades = [0]; var tempgrade = 0; var averagetotal = 0; for(i=0;i<numberofgrades;i++;){ if(countingvalue!=numberofgrades){ var tempgrade= prompt("what "+countingvalue"th grade?") grades.push(tempgrade); countingvalue++; } else if(countingvalue==numberofgrades){ for(var j=1;j=<numberofgrades;j++){ averagetotal = grades[j]+averagetotal; } } alert("your average grade is: "+(averagetotal/numberofgrades)); newest edited code- var numberofgrades = prompt("how many grades want calculate?"); var countingvalue = 1; var grades = [0]; var tempgrade = 0; var averagetotal = 0; for(i=0;i<numberofgrades;i++){ if(countingvalue!=numberofgrades){

swift2 - Haneke - hnk_setImageFromURL -

i tried hnk_setimagefromurl says "value of type 'uiimageview' has no member 'hnk_setimagefromurl'. i have imported haneke.xcodeproj manually. on top of class there 'import haneke'. in project under 'build settings' architectures, needed change 'build active architectures only' setting 'yes' worked.

javascript - Change value of single dropdown -

i have run problem , i'm not sure how around it. have 5 dropdown buttons, , when select 1 option first dropdown, changes option 5 dropdowns. any appreciated :d (p.s. copied 1 block of code 1 button. note 5 dropdowns in same of modal). the function i'm trying use update is $(".dropdown-menu li a").click(function() { $("#communityone").text($(this).text()); $("#communityone").val($(this).text()); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" id="communityone" data-toggle="dropdown">choice 1 <span class="caret"></span> </button> <ul class="dropdown-menu" id="c11"> <div class="col-md-2"> <li role="presentation">

javascript - Youtube API - Can't add a video to a playlist -

i've had success requests youtube api v3, having problems getting post version work, adding video playlist. i've tried many combinations of things, putting key in query string, access token in either query string or header, json vs. jsonp, still no luck. i got work fine in api explorer request prints out basic pieces without context code make work, i'm guessing i'm messing in implementation of calling ajax post command. here's i'm doing: var myaccesstoken = "blahblah"; //from oauth2, works fine other calls $.ajax({ type: "post", url: "https://www.googleapis.com/youtube/v3/playlistitems?part=snippet&access_token=" + myaccesstoken, data: { "snippet": { "playlistid": "plijo1t8cdbpghojrgegmgfmb-vtaus_x9", "resourceid": { "kind": "youtube#video", "videoid": "kmguygy5gvy" },

What is that linker error in my first project in iOS development (objective-C)? -

Image
i came across problem below in first project. linker error? between model , viewcontroller files? apple mach-o linker error: "_objc_class_$_obebokekmodel", referenced , apple mach-o linker error: linker command failed exit code 1 (use -v see invocation) i appreciate if can help. thanks! this means linker can't find class name obebokekmodel in objective-c 1 way can happen if .m file isn't added target building. select file .m , view file inspector make sure there checkmark next target building.

java - Why won't StdDraw get recognized no matter what? -

i tried in 2 popular ides, eclipse , netbeans, import jar file named stdlib contains bunch of stuff. stddraw part of after referencing it, ides keep telling me doesn't exist when use methods. i have browsed stackoverflow , read other questions/answers , followed instructions letter. why not working? that jar file puts classes in default package. ( terrible idea) to use have 2 options: put of files access in default package use alternative version of library ( http://introcs.cs.princeton.edu/java/stdlib/stdlib-package.jar ) see adding default package's classes in netbeans

modulo - Can someone explain to me how ( (c-65+k)%26)+65) works in a caesar cypher? -

if c numerical value of uppercase character (i.e. b 66) , sake of argument, k key value of 2? i'm new programming , don't understand how modulo works in this. know takes value of remainder, wouldn't simplify this? c = b = 66 k = 2 imagine result should 'd' (66 - 65 +2)%26 +65 (3)%26 +65 0 + 65 65 = 'a' i must not understand way % works. key fact - ascii code of letter"a" 65. here how cypher works - original expression in question title. take ascii value of letter, subtract value of "a" giving 0 based number. add key value number shifting k places. now divide number got above 26, discard quotient , use remainder. modulo operator % . keeps numbers in 0-25 range, since dividing 26 never have remainder great 25. add 65 convert "encrypted" uppercase letter. this allows key number , still keeps "encrypted" output within ascii range of a-z. you interpreting % operator division. in real

visual studio - How to assign current system time to a String^ variable? -

how can current system time @ button click event , assign string^ variable in (possibly) specified format (like:yyyy-mm-dd-hh-mm-ss)? i using visual studio 2013. you can use time function localtime function. example code: //#include <time.h> time_t rawtime; struct tm * timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); //the years since 1900 according documentation, add 1900 actual year result. printf("date: %d/%d/%d time: %d:%d:%d",timeinfo->tm_year + 1900, timeinfo->tm_mon, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);

How to make directories for an specific user using C, CGI, HTML? -

and have issue, im creating directories using c, cgi , html, started 2 source codes, 1 this: /* * newdir.c - create directory */ #include <unistd.h> #include <fcntl.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { printf("\n#argumentos: %d\n", argc); if(mkdir(argv[1], 0777)) { perror("mkdir"); exit(exit_failure); } exit(exit_success); } and have other one: #include <stdio.h> #include <stdlib.h> #include <string.h> // here same sampleprogram.c except // there differences when have read in string int main(void) { char *data; char* s = malloc(100 * sizeof(char)); printf("%s%c%c\n", "content-type:text/html;charset=iso-8859-1",13,10); int length = atoi(getenv("content_length")); int j =0; char c; c = getchar(); data = malloc(sizeof(char) * (length + 1) ); while ( c != eof && j < length ) {

Iterate over Guava ImmutableList in Scala -

i'm having trouble iterating on immutablelist guava in scala. reason i'm working them because i'm working code written in java uses guava api. however, compiler doesn't seem it. here's code: for (blockdata: iblockdata <- block.p.a) { *insert actions here* } the compiler errors this: error:(24, 43) value filter not member of com.google.common.collect.immutablelist[net.minecraft.server.v1_8_r3.iblockdata] (blockdata: iblockdata <- block.p.a) { ^ any appreciated. thanks! to use scala s for expression object has implement flatmap , filter guava collections not. scala comes bundled java converters, should work: import collection.javaconverters._ (blockdata: iblockdata <- block.p.a.asscala) { *insert actions here* }

ruby on rails - Pass Reset - No route matches [PATCH] "/password_resets.SOLceKJXoax55zSBAfAhTQ" -

i'm doing michael hartl rails tutorial , trying implement password reset functionality request sends password reset form (the form reset password) looks /password_resets.solcekjxoax55zsbafahtq rails says: no route matches [patch] "/password_resets.solcekjxoax55zsbafahtq" in tutorial asked use route: resources :password_resets, only: [:new, :create, :edit, :update] error message. this how password_resets_controller.rb update method looks like: def update if password_blank? flash.now[:danger] = "password can't blank" render 'edit' elsif @user.update_attributes(user_params) log_in @user flash[:success] = "password has been reset." redirect_to @user else render 'edit' end end any idea how method or route causing error? thank in advance. update: adding reset password view (password_resets\edit.html.erb) <% provide(:title, 'reset password') %> <h1&g

c - Linux serial port - wrtie( ) byte to the target device through serial port -

unsigned char cmd[] = {'a', 't', '+', "0x07", "0x08", 'd', 'f', "0xa6"}; to write command target device, expect write byte 41 54 2b 07 08 44 46 a6 accordingly. however, actual bytes written device 41 54 2b b8 bb 44 46 and it's obvious wrong @ 0x07 0x08 0xa6 how write bytes expect have in above example ? ----- write function ------- void writetodevice(){ unsigned char cmd[]={'a', 't', '+', "0x07", "0x08", 'd', 'f', "0xa6"}; int n = write(fd,&cmd,8); for(p=0;p<8;p++){ printf("bytes written: %02x \n", cmd[p]); } if(n<0){ printf("write error \n"); } else{ printf("%d bytes written \n", n); } }; compiler warning warning: (near initialization ‘cmd[3]’) [enabled default] warning: initialization makes integer pointer without cast [enabled default] instead of &qu

R Script Markov Chain -

there 26 states: matrix of size [26, 26]: markov model: getting error: byrow <- true library(markovchain) mcweather111 <- new("markovchain", states = c("start", "1", "2","3","4","5","6", "7", "8", "9,"10", "11","12", "13", "14", "15", "16", "17","18", "19", "20", "21", "22","23","24","end"), transitionmatrix = matrix(data = c( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2, 0.2, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.2, 0.0, 0.2, 0.0,

css - which is less resource intensive: wrapping multiple divs with an extra html element, or styling several unwrapped elements individually? -

ok, i've been taught should use wrapper <div></div> if absolutely necessary, since creating unneeded element in dom wastes resources. however, let's have 5 child elements need left margin of 10%. writing css each 1 less intensive making new div? so code this: scenario 1: wrapper <div class='wrapper'> <div class='div1'></div> <div class='div2'></div> <div class='div3'></div> <div class='div4'></div> <div class='div5'></div> </div> .wrapper{ margin-left: 10px } scenario 2: no wrapper , elements styles 1 css entry <div class='div1'></div> <div class='div2'></div> <div class='div3'></div> <div class='div4'></div> <div class='div5'></div> .div1, .div2, .div3, .div4, .div5{ margin-left:

algorithm - How to generate a random number <= 7 from two random numbers <= 5? -

here reference implementation , not understand why choose 21 here? thanks. public static int rand7() { while (true) { int num = 5 * (rand5() - 1) + (rand5() - 1); if (num < 21) return (num % 7 + 1); } } btw, read question before asking, specific question why using 21 here. in thread, not answered. if missed anything, please feel free correct. thanks. :) in advance, lin it's because 21 multiple of 7. the term 5 * (rand5() - 1) + (rand5() - 1) produces number in range [0, 24] (uniform distribution). used create random number in [0, 6] % 7 . however, not produce uniform distribution if use entire range. remainders 0, 1, 2, 3 occur once more remainders 4, 5, 6. therefore, according numbers produce 1 of these remainders cut off , range [0, 20] ( < 21 ) used. equivalently cut off first 4 numbers ( > 3 ) produce uniform distribution.

javascript - AngularJS Forgot password -

Image
i have forgot password form, on when user enters email hits backend , sends out email link user below. the user clicks on link, invokes back-end service. how can control url via angular ? so, calls back-end resouce, want url handled in front-end too. if question not clear, can show me example of forgot password implementation in angularjs , nodjs or backend. if can change link in email change in following way: http://localhost:3000/#/resetpassword/<token> now in angular route need listen route following: angular.module('myapp', ['ngroute']) .controller('resetpasswordcontroller', function($scope, $route, $routeparams, $location) { //password resetting functionality }) .config(function($routeprovider, $locationprovider) { $routeprovider .when('/resetpassword/:token', { templateurl: 'reset.html', controller: 'resetpasswordcontroller', resolve: { // call backend service check if to

ruby on rails - Socialization gem - two issues -

since implementation trivial, know suggestion how use socialization gem show "posts" associated followed user. there wasn't coherent description in gem guide. this tried post.where(id: current_user.followers.pluck(:id)) throws error wrong number of arguments (0 1..2) also, suggested in guide show follower/followee count, there strange output. count in view starts off -2 , counts upwards there. migration add_column :users, :followers_count, :integer, :default => 0 user model devise thanks. as can see in socialization calling method followers wrong in current_user check code mentioned inside it all followers celebrity.followers(user) so can see current_user.followers.pluck(:id) wrong correct it.

jquery - stop a function declared inside setInterval() using clearInterval() -

how stop function declared inside setinterval(), like var start = function(){ setinterval(function(){//do something},3000) }; var stop = function() { clearinterval(start); }; $('button.start').click(function(){ start(); }); $('button.stop').click(function(){ stop(); }); but still not able stop setinterval function here. need little on that. thanks declare variable interval . setinterval create id. then assign setinterval id inertval variable . if wanna stop setinterval pass inertval clearinterval try var interval; var start = function(){ interval=setinterval(function(){ //do },3000) }; var stop = function() { clearinterval(interval); };

oracle - Getting multiple column values in single row -

this actual result , have used store details of client sid attribute_values attribute_id ---------- ---------------- ----------- 20 101010 membership_no 20 allen membership_name 20 ward membership_lname 30 101011 membership_no 30 martin membership_name 30 blake membership_lname in need retrieve details based on membership no , using sid. sid unique number . need show result sid membership_no membership_name membership_lname ----- ------------- --------------- ---------------- 20 101010 allen ward 30 101011 martin blake above 3 attributes constant using values client number, names inserts table. im stuck this...i need solution it. this query have used retrieve details. returns empty select sid, listagg(attribute_value, ',') with

I have two questions regarding C# -

in submitbutton_click method, i'm trying add code increase score 20 points every correct answer. reason not adding 20 points each time answer question correctly says 0. other question when 2 random variables change when click new , type in right answer marks incorrect. messing somewhere regarding these 2 problems? here code using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace lab4 { public partial class lab4 : form { public lab4() { initializecomponent(); score = 0; } private int score = 0; private int product = 0; private int answer = 0; private void submitbutton_click(object sender, eventargs e) { try { answer = int.parse(answertextbox.text); if(con

jquery - How to change font size in JQPlot -

i using following code built simple line chart using jqplot. $(document).ready(function(){ var line1 = [14, 32, 41, 44, 40, 47, 53, 67]; var plot1 = $.jqplot('chart1', [line1], { title: 'chart point labels', seriesdefaults: { showmarker:false, pointlabels: { show:true } } }); }); i want change font size of label. ideas on how it?? in advance after chart renders can detect code behind using dev tools chrome dev tools or fire bug. as long chart plugin creates standard markup , not svg or canvas, can resolve way catch labels through css using proper css selector apply font and/or other styling need labels.

entity framework 6 - Cannot download System.Data.Sqlite via Nuget in VS2015 -

i'm trying download package system.data.sqlite ef6 support via stock nuget in visual studio 2015 community. after pressing "install", i'm getting asked dependencies. then, after confirming, nothing happens while , then, in output window, "object reference not set instance of object" error. upgraded nuget 3.2.x, problem persists. can resolve it? edit: log output console: attempting gather dependencies information package 'system.data.sqlite.1.0.98.1' respect project 'wptmanager', targeting '.netframework,version=v4.5.2' attempting resolve dependencies package 'system.data.sqlite.1.0.98.1' dependencybehavior 'lowest' resolving actions install package 'system.data.sqlite.1.0.98.1' resolved actions install package 'system.data.sqlite.1.0.98.1' install failed. rolling back... package 'entityframework 6.0.0' not exist in project 'wptmanager' package 'entityframework 6.0.0' n

How Can we add a Google like Search box in java Swing? -

this question has answer here: how create search bar similar google search style in java gui 1 answer fast search in java swing applications? 6 answers i tried code dynamic list in combobox after typing not add whole word on selected item in combobox. how can make more dynamic google search box? you can use code dynamically update combobox using database connection..... //code: string pattern=tabletcombobox.getselecteditem().tostring(); system.out.println(pattern); //tabletcombobox.setselecteditem(pattern); //autocompletedecorator decorator; //autocompletedecorator.decorate(tabletcombobox); try { class.forname("com.mysql.jdbc.driver"); connection con=drivermanager.getconnection(url,username,password);

startup - Cannot run Eclipse; JVM terminated. Exit code=13 -

Image
i append -vm c:\program files\java\jre6\bin\javaw.exe in eclipse.ini try start eclipse again , got error. give me how solve or link solve it. this eclipse.ini -startup plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.r36x_v20100810 -showsplash org.eclipse.platform --launcher.xxmaxpermsize 256m --launcher.defaultaction openfile -vm c:\program files\java\jre6\bin\javaw.exe -vmargs -xms40m -xmx384m thank you it may way error shows (and not how written in eclipse.ini file), there text in eclipse.ini (specifying jvm) says following: the -vm option , value (the path) must on separate lines. the value must full absolute path java executable, not java home directory. the -vm option must occur before -vmargs option, since after -vmargs passed directly jvm

java - How to make JLabel still appear after JTable column swap in the runtime? -

Image
i have jtable : after swap columns unfortunately flags not rendered anymore: i assume fault of getcolumnclass method have fixed class every column, don't know how fix issue. package zad1; import java.awt.borderlayout; import java.awt.color; import java.awt.component; import java.awt.image; import java.awt.image.bufferedimage; import java.io.bufferedreader; import java.io.file; import java.io.filereader; import java.util.arrays; import java.util.vector; import javax.imageio.imageio; import javax.swing.icon; import javax.swing.imageicon; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jtable; import javax.swing.table.defaulttablemodel; import javax.swing.table.tablecellrenderer; import javax.swing.table.tablemodel; public class countrytable extends jtable { public countrytable(string countriesfilename) { vector<string> columnnames = new vector<string>(); vector<vector<object>> data = new vector

jquery - Joomla install stuck -

i'm trying install latest joomla (3.4.4) on new host. copied files server, fired browser , first install screen. box can select site online/offline not visible , results in next button not working. when in chrome devtools can see 5 errors : uncaught referenceerror: jquery not defined. i've never had before. idea can fix this? thanks in advance, cheers, peter

c - I get the error message:Expression: (L “String is not null terminated” & & 0) -

when run program,i error message.i don't konw how correct it.may help? char dir[1024]="c:\\users\\username\desktop\\new folder\\pauli\\t3"; void check_dir(char *dir) { int i; = 0; while (dir[i] != '\0') { if (dir[i] == '/') dir[i] = '\\'; i++; } strcat_s(dir, sizeof(dir),"\\"); } sizeof(dir) doesn't expect here. dir char * inside function, gives size of pointer (*). option pass size of array check_dir() function, too: void check_dir(char *dir, size_t bufsize) { [...] strcat_s(dir, bufsize, "\\"); } (*) in scope dir declared char dir[1024] , sizeof(dir) will give expected result. edit: on side note, check_dir() misnomer here, doesn't check tries normalize string windows path backslashes. call e.g. win32_normalize_path() or that. called check_<foo>() should return (e.g. int ) containing result of check.

orchardcms - make object using Some of my command at runtime in orchard in -

have command ant executed times end user(admin interface) in orchard, know what's recipe , orchard.exe! want execute commands admin interface! thanks lot! you can upload recipe admin ui anytime check here: orchard recipes , here there modules once enabled run recipes. and @ source, here code recipe recipe = _recipeharvester.harvestrecipes(module.descriptor.id).firstordefault(x => !x.issetuprecipe && x.name == name); if (recipe == null) { return httpnotfound(); } try { _recipemanager.execute(recipe); } catch(exception e) { logger.error(e, "error while executing recipe {0} in {1}", moduleid, name); services.notifier.error(t("recipes contains {0} unsupported module installation steps.", recipe.name)); }

c++ - Can a template be instantiated if there is nested type (not accessed) with a method that cannot be compiled? -

i accidentally found g++ (5.2.0) compiles following template<typename t> struct { int x; struct b { void foo() { x = 1; } }; }; even istantiating a , a::b , provided member b::foo not used. reasonably instead compile error x being non-static member of a compiling no-op statement &a<int>::b::foo; . clang (3.6.2) refuses template if a not instantiated @ because says non-static member name x cannot used inside b while reading template definition. is bug in g++ or clang being strict template members not instantiated? the x in code non-dependent name, , standard renders template cannot validly instantiated whatever provide template parameter ill-formed, no diagnostic required (actually applies "temploids", example in standard shows. is, rules apply equally members of class templates). your code invalid normal class accesses name of surrounding class. notice direction important here. following no

javascript - Repeat HTTP requests until 404 error is returned -

i send http requests until 1 of them responds error 404 . there 21 pages , have this: _getall = function () { var promises = []; var pages = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]; angular.foreach(pages, function (page) { var deffered = $q.defer(); $http({ url: 'http://api.tvmaze.com/shows?page=' + page, method: 'get' }). success(function (data) { console.log("ok") deffered.resolve(data); }). error(function (error) { deffered.reject(error); console.log(error.status); }); promises.push(deffered.promise) }) return $q.all(promises); }, but if try http://api.tvmaze.com/shows?page=22 returns 404 error . so there option make http request until 1 of them returns 404 . while looping or somehow else? these calls asynchronous while loop try make calls 1000s o

.htaccess - Apache: include htaccess in conf with AllowOverride None, better performance? -

suppose have /home/example.org/public_html/ directory on filesystem, serves document root of virtualhost. the relevant httpd configuration vhost this: <virtualhost *:80> servername example.org:80 ... documentroot /home/example.org/public_html <directory /home/example.org/public_html> allowoverride ... </directory> ... </virtualhost> in order prevent htaccess lookups on filesystem without losing htaccess functionality – @ least @ documentroot level- transformed configuration following: <virtualhost *:80> servername example.org:80 ... documentroot /home/example.org/public_html <directory /home/example.org/public_html> allowoverride none include /home/example.org/public_html/.htaccess ... </directory> ... </virtualhost> difference allowoverride none include /home/example.org/public_html/.htaccess let’s see have accomplished this: httpd not waste time looking , parsing htacce

c# 4.0 - C# Loops, the input value of a textbox -

i'm newbie here , confuse c#. here question must value user input on textbox , loop value textbox have, example textbox have 5 answer on label , must 12345. it not loop, when execute program result input value on textbox int intloop; (intloop = 0; intloop <= convert.toint32(txtevaluate.text); intloop++) { lblloop.text = intloop.tostring(); } try appending loop's iterator textbox using += : lblloop.text = string.empty; (int intloop = 1; intloop <= convert.toint32(txtevaluate.text); intloop++) { lblloop.text += intloop.tostring(); }

angular - angular4.x docs for offline reading -

i wanted know how angular 4.x docs offline. i have cloned angular repo github. ran yarn aio directory(as mentioned in readme ). however gives me following error yarn install v0.27.5 [1/4] resolving packages... success up-to-date. $ uglifyjs node_modules/lunr/lunr.js -c -m -o src/assets/js/lunr.min.js --source-map fs.js:652 return binding.open(pathmodule._makelong(path), stringtoflags(flags), mode); ^ typeerror: path must string or buffer @ object.fs.opensync (fs.js:652:18) @ object.fs.writefilesync (fs.js:1299:33) @ /users/apple/code/angular/aio/node_modules/directory-encoder/node_modules/uglify-js/bin/uglifyjs:311:12 @ /users/apple/code/angular/aio/node_modules/directory-encoder/node_modules/async/lib/async.js:188:33 @ /users/apple/code/angular/aio/node_modules/directory-encoder/node_modules/uglify-js/bin/uglifyjs:254:9 @ trytostring (fs.js:513:3) @ fsreqwrap.readfileafterclose [as oncomplete] (fs.js:501:12) error command f

javascript - Why this Angular 4 custom validator return a Promise or an Observable? What is the exact logic? -

i new in angular 4 , not javascript\typescript , have following doubt example found in tutorial. it related implementation of custom form validator doubts more observable , promise objects. so have this: import {form, formcontrol} '@angular/forms'; import {observable} 'rxjs/observable'; export class customvalidators { static asyncinvalidprojectname(control: formcontrol): promise<any> | observable<any> { const promise = new promise((resolve, reject) => { settimeout(() => { if (control.value === 'testproject') { resolve({'invalidprojectname': true}); } else { resolve(null); } }, 2000); }) return promise; } } the asyncinvalidprojectname() method implements logic of custom validator. my doubts are: 1) seems me method can return promise object or observable object. why? seems me return promise object represents if input in form valid or not. wh

javascript - Multiple resizeText in one html -

i have made fiddle : http://jsfiddle.net/1an9yh78/ i can't buttons change specific font-size in assigned div. it's only changing 1 div . help. html <div id="t1"> text1 </div> <input name="resize1" type="button" value="&nbsp;+&nbsp;" onclick="resizetext(1)" /> <input name="resize2" type="button" value="&nbsp;-&nbsp;" onclick="resizetext(-1)" /> <div id="t2"> text2 </div> <input name="resize3" type="button" value="&nbsp;+&nbsp;" onclick="resizetext(1)" /> <input name="resize4" type="button" value="&nbsp;-&nbsp;" onclick="resizetext(-1)" /> javascript function resizetext(multiplier) { var elem = document.getelementbyid("t1"); var currentsize = elem.style.fontsize || 1; elem.style.font

javascript - Can't get rid of Uncaught Error: _registerComponent(...): Target container is not a DOM element -

this not new issue, have been reported other users too, problem have tried many solutions not able rid of error, , strangely doesn't cause problem in running app, works fine, why throws error, must doing damage app not able figure out. following things have tried, nothing works putting <script src="/bundle.js"></script> in end of </body> tag, after </body> tag inside </html> tag. added type="text/javascript" 1 solution. added async in <script> tag. moreover have upgraded webpack version 1 latest one, , landed error, come conclusion webpack had bug or, something? following error stack receiving.. uncaught error: _registercomponent(...): target container not dom element. @ invariant (12:44) @ object._rendernewrootcomponent (369:310) @ object._rendersubtreeintocontainer (369:401) at object.render (369:422) @ eval (729:78) @ object. (bundle.js?61622f7508eae70357c3:4906) @ webpac

"export 'Params' was not found in '@angular/router' -

Image
in angular app, have imported params angular/router many times. in particular component getting error: "export 'params' not found in '@angular/router' code: import { params, activatedroute } '@angular/router'; //it works fine in parent component while gives warning in child component screenshot: my angular specs: not sure why import params in code. assume you're using receive parameters during navigation. never explicitly import params, e.g. constructor(route: activatedroute) { this.productid = route.snapshot.params['id']; } starting angular 4, use parammap instead: constructor(route: activatedroute) { this.productid = route.snapshot.parammap.get('id'); } if none of above solves problem, put breakpoint in code , see if route.snapshot.params contains expected value - problem may on sending part (the parent route).

c++ - Microsoft GUID serialization using boost serialize? -

i have following: struct member { guid id; int extra; template<class archive> void serialize(archive & ar, const unsigned int file_version) { ar & id; ar & extra; } } when compile code following compile error: error 25 error c2039: 'serialize' : not member of '_guid' how specialise boost serialization microsoft guid? here's hint: assuming uuid type pod, can use make_binary_object . here's mockup type uuid pod: #include <array> using uuid = std::array<uint8_t, 16>; // mock static_assert(std::is_pod<uuid>(), "assumes uuid pod"); any pod do. e.g. boost::uuids::uuid ¹ pod. same struct uuid { char data[16]; } etc. non-intrusive serialization: #include <boost/serialization/serialization.hpp> #include <boost/serialization/binary_object.hpp> namespace boost { namespace serialization { template <typename ar> void seri

Facebook PHP Graph SDK performance issue -

i'm using facebook php sdk v5 simple task: converting javascript short-lived user token long lived 1 , returning it. the issue i'm having requests seem take long time when issued sdk compared postman or graph api explorer. in order benchmark have used profiling calls, i'm measuring both high level execution times , lowest level possible (wrapping curl call) make sure issue not related additional php overhead. $fb = new facebook\facebook([ 'app_id' => $options['app_id'], 'app_secret' => $options['app_secret'], 'default_graph_version' => 'v2.10', ]); $helper = $fb->getjavascripthelper(); $prev = performancelog($prev, 'fbinit'); try { $accesstoken = $helper->getaccesstoken(); } catch (\facebook\exceptions\facebookresponseexception $e) { // when graph returns error die(500); } catch (\facebook\exceptions\facebooksdkexception $e) { // when validation fails or other local is

android - Error "Incompatible types" while adding NativeAds in recyclerView -

i trying add native ads in recyclerview. following tutorial . looks recyclerviewadapter little bit different have them. package com.comp.app.adapters; public class recyclerviewadapter extends recyclerview.adapter<recyclerviewadapter.recyclerviewholder> { private context context; private constants constants; private string androidid; private string id; private arraylist<cardsettergetter> arraylist = new arraylist<cardsettergetter>(); private arraylist<string> favouriteitemlist = new arraylist<string>(); private int totalcount; private static final int menu_item_view_type = 0 ; private static final int ad_view_type = 1; public recyclerviewadapter(context context, arraylist<cardsettergetter> arraylist, arraylist<string> favouriteitemlist, int totalcount) { this.arraylist = arraylist; this.context = context; this.arraylist = arraylist; this.favouriteitemlist = favouriteitemlist; this.totalcount = totalcount; } @over