Posts

Showing posts from March, 2010

c# - Upgrade Outlook 2003/07/10/13 addin to be used for Click-to-Run (C2R) -

i have addin compatible outlook 2003 - 2013 using various versions of vsto. it seems majority of small businesses have click release version, not compatible addins. is there way make addin compatible 2013 c2r, or need rewritten "app" using napa? c2r office installation load com addins in same way regular version of office, there nothing need do. what exact problem running into?

ios - RACObserve(), RAC() - how to set a BOOL value based on an NSString -

being reactivecocoa newbie, i'm hoping advice this: i'm trying create dynamic form contains multiple field objects parsed xml file. each field can have muliple validation rules run against field's nsstring *value param. for rac part of question- inside each field object, want bind bool completed signal checks field's *value param against array of rules. far i've gotten here thinking: @implementation field self = [super init]; if (self) { rac(self, completed) = [racobserve(self, value) filter:^bool(nsstring *fieldvalue) { nslog(@"%s::self.completed = %d\n", sel_getname(_cmd), self.completed); // trying watch values here, no luck nslog(@"%s::fieldvalue = %@\n", sel_getname(_cmd), fieldvalue); // same here, i'd able view `*value` here far no luck return [self validatecurrentvalue]; // method checks value.length > 5 }]; } return self; the *value param has been bound view model (success...

asp.net - Error with Embedded code blocks using Javascript in .net -

i error unterminated string constant when give <input type="button" name="cancel" value="close" onclick="javascript:top.location.href = '../admin/page.aspx?curtab=<%=curtab%>';"> and unterminated string constant , syntax error @ '&' following line of code <input type="button" name="cancel" value="close" onclick="javascript:top.location.href = 'plan.aspx?res=<%=request("res")%>&count=<%=request("count")%>';"> can please tell me whys happens?i suppose because of embedded code block. please me thanks in advance ! i don't think scenario can handled inline. try prepare text rendered inside onclick='[]' beforehand. first statement, example: <% var bb = string.format("javascript:top.location.href = \"../admin/page.aspx?curtab={0}\";", curtab); %> <input type=...

node.js - Writing the data in mongodb -

i inserting huge amount of data on mongodb using node.js. program working fine , can see in database path of mongo db data written files of databasename.0 128 kb, databasename.1 256 kb, databasename.0 512 kb,databasename.0 1024 kb, , last file of 2048 kb while inserting last file of 2048 kb connection lost mongodb , data not inserted. why happening how rid of please explain me concept. attach code using insert data. // connection.js used establish connection var db = require('mongodb').db; var connection = require('mongodb').connection; var server = require('mongodb').server; var connectioninstance; module.exports = function(callback) { if (connectioninstance) { callback(connectioninstance); return; } var serveroptions = { 'auto_reconnect': true, 'poolsize': 100 }; var db = new db('test', new server('localhost', 27017, serveroptions)); db.open(function(err, databasecon...

java - Why do bytebuffer give buffer overflow exception when buffer is not full -

i'm not sure why following example gives buffer overflow exception. hope can explain why, , how can correctly. it's simple this: bytebuffer bf = bytebuffer.allocate(4); bf.order(byteorder.big_endian); bf.putint(8); bf.putint(7); // throws exception the goal: [0,0,8,7] thanks in advance! an int 4 bytes long should multiply 4 number of int need store in bytebuffer.

c# - Returning datatable using entity framework -

i using entity framework. there 1 particular situation in application have use stored procedure. since there lot of sql statements written in sp, don't want re-write in c# code. need result in form of datatable. have written little bit of code stuck @ 1 point. can complete code below? using (dbcontext.database.connection) { dbcontext.database.connection.open(); dbcommand cmditems= dbcontext.database.connection.createcommand(); cmditems.commandtext = "getavailableitems"; cmditems.commandtype = commandtype.storedprocedure; cmditems.parameters.add(new sqlparameter("jobcardid", 100525)); //need write code below populate datatable. } thanks lot guys. solved it. here solution: datatable dt = new datatable(); var context = new databasecontext(); var conn = context.database.connection; var connectionstate = conn.state; try { using (context) { if (connectionstate != connectionstate.open) conn.open(); ...

rjava - java.lang.NullPointerException (No Data Viewer Loaded) JGR, Deducer -

i'm running deducer on osx 10.9.2. don't know why today received error no data viewer: loading required package: deducerextras > java.lang.nullpointerexception @ org.rosuda.deducer.jgrconnector.idleeval(jgrconnector.java:39) @ org.rosuda.deducer.deducer.idleeval(deducer.java:611) @ org.rosuda.deducer.data.dataviewercontroller.refreshdata(dataviewercontroller.java:212) @ org.rosuda.deducer.data.datarefresher.run(dataviewercontroller.java:252) @ java.lang.thread.run(thread.java:695) do know how can fix issue? here sessioninfo() r version 3.0.3 (2014-03-06) platform: x86_64-apple-darwin10.8.0 (64-bit) locale: [1] en_us.utf-8/en_us.utf-8/en_us.utf-8/c/en_us.utf-8/en_us.utf-8 attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] deducerspatial_0.7 scales_0.2.4 openstreetmap_0.3.1 rgdal_0.8-16 raster_2.2-31 maptools_0....

authentication - Accessing files on dropbox with client-side Javascript from http only -

i'm trying add dropbox support client-side-only javascript app ( http://bbc.godbolt.org/ ). best can tell can't authenticate without site being hosted on secure server. for variety of reasons it's tricky me https server set up, , i'm not using server endpoints don't see why dropbox/oauth mandates https:// source url. i can't find reference limitation, can't configure non-https server in dropbox configuration app; , without specifying endpoint client-side authentication fails. am missing something? thanks! https required oauth 2 spec reason... access token returned @ end of authorization process in plain text , stolen if not sent on secure channel.

visual studio 2012 - Create subfolders with specific order on Project -

hi want know if its' possible create sub folders under 1 folder specific order. i'm working in vs 2012 using mvc project. in project go folder right click add new folder , after creating couple of folder, order of folder can't changed . idea of how it? tried putting names "1.foldera", "2. folderb" doesn't work.

javascript - Is it possible to change color of axis labels and format them jsxgraph? -

i created ticks using following code: xticks=plot.create('ticks',[xaxis, 2]); is possible change color of labels , format label values (like adding custom string)? xticks.label.setattribute({strokecolor:"red"}) doesn't work. thank you. the sub-object label not work tick labels, since there more 1 label. 1 can change visual appearance of labels providing label sub-attribute. xaxis = board.create('axis', [[0,0],[1,0]]); xaxis.removeallticks(); xticks = board.create('ticks',[xaxis, 2], { drawlabels: true, strokecolor: 'red', label: { offset: [-4, -15], strokecolor: 'blue' } }); another possibility provide same information ticks sub-attribute: xaxis = board.create('axis', [[0,0],[1,0]], { ticks: { drawlabels: true, strokecolor: 'red', label: { offset: [-4, -15], ...

Android Java math logic issue -

i want message player if score specific score. what using .. if(score <= 4){ messageplayer("you scored 1."); } else if(score <= 19){ messageplayer("you scored 1."); messageplayer("you scored 5."); } else if(score <= 49){ messageplayer("you scored 1."); messageplayer("you scored 5."); messageplayer("you scored 20."); } else if(score <= 99){ messageplayer("you scored 1."); messageplayer("you scored 5."); messageplayer("you scored 20."); messageplayer("you scored 50."); } else if(score >= 100){ messageplayer("you scored 1."); messageplayer("you scored 5."); messageplayer("you scored 20."); messageplayer("you scored 50."); messageplayer("you scored 100."); } the scores want are: 1 point 5 20 50 100 is logic 100% right , accurate? think first 1 score <= 4 wrong , if get...

php - Extract JSON Array from data -

i requesting data website , expecting clean json array in return. however getting instead: <pre></pre>{"status":"success","result":1} which won't parse json_decode();. how extract json array out of data can parse it? note: not in control of code requesting data from. try this $output_array = array(); $badstr = '<pre></pre>{"status":"success","result":1}'; preg_match("/{.*}/", $badstr, $output_array); in $output_array[0] have json string.

cmd - Is it posible to copy a folder from another computer using a java application locally? -

before have copied files computer , that's not problem. when try opposite, can't. i'm trying copy files computer, i'm running program in mine. i'm using java, windows xp, , have privileges use folder. this code: string rutao = "pc1234/folder/"; //the folder want copy string rutad = "d:/reportes"; // want put other folder runtime.getruntime().exec("cmd /c copy \"" + rutao + "\" \\\\" + "" + rutad + ""); i'd appreciate help. well code looks like: string rutac = "pcvw234103r\\retrabajos_ks1_2014"; string rutao = "d:\\retrabajos_ks1_2014\\generales\\" + nombrec + ".pdf"; runtime.getruntime().exec("cmd /c copy \"" + rutao + "\" \\\\" + "" + rutac + ""); and @ end pass cmd: cmd /c copy "d:\retrabajos_ks1_2014\generales\turbina ruidosa(material suelto),nuevo formato.pdf" \\pcvw234103r\retr...

ios - Present a view controller on different UIWindow -

i need solving problem i've been having 2 whole days. let had custom view controller handles image slideshows , can used embed on view or present via navigation controller or modal view. has full screen options can turned on using code _fullscreenwindow = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; _fullscreenwindow.backgroundcolor = [uicolor blackcolor]; _fullscreenwindow.windowlevel = uiwindowlevelnormal; _fullscreenwindow.rootviewcontroller = self; [_fullscreenwindow makekeyandvisible]; i stored original window beforehand can restore state when exiting full screen. calls orientation methods, not called when in navigation controller. while in full screen mode state, there option can presented uitableviewcontroller in theory can present using code. uitableviewcontroller *mediaoptionscontroller = [[uitableviewcontroller alloc] initwithstyle:uitableviewstylegrouped]; uinavigati...

Wordpress Admin Bar appears at bottom and without CSS -

Image
after upgraded wordpress 3.9, noticed admin bar appearing on bottom , looks not loading css it. have changed theme twenty-fourteen , still @ bottom. know not theme issue have no idea issue or how fix or @ least disable it. also, works fine on admin page. check if have wp_deregister_style('open-sans'); in theme can couse!

mysql - Select distinct to remove duplicate rows? -

i have forum posts , comments table. i'd sort recent comments: select distinct(p.id) ,p.title ,c.id posts p ,comments c c.post_id = p.id order c.id desc limit 50; however row every comment. know want loop through recent comments , grab first 50 unique posts. can't translate sql. here's solution without subqueries: select p.id, p.title, max(c.id) comment_id posts p join comments c on c.post_id = p.id group p.id order comment_id desc limit 50 this way may bit faster , more scalable despite subquery because can optimize on limit clause: select p.id, p.title, max(c.id) comment_id posts p join (select distinct c.post_id comments c order c.id desc limit 50) t on t.post_id = p.id join comments c on c.post_id = p.id group p.id order comment_id desc make sure there index on comments(post_id) .

Visual Studio 2010 C# Debugger Does not Stop on New Breakpoints -

i have c# program in debugger has peculiar behavior in regards breakpoints. if breakpoints set when "start debugging", debugger stops @ breakpoints. if add breakpoints while program running, debugger not stop @ of breakpoints. however, debugger continue stop @ breakpoints set when started program. new breakpoints work correctly, have stop program , start again or detach , re-attach debugger. also, if disable breakpoint while program running , re-enable breakpoint, debugger no longer stops on breakpoint. in order breakpoint work correctly again, have stop program , start again or detach , re-attach debugger. i prefer not have detach , re-attach debugger every time want add new breakpoint. know why happening , how make debugger correctly stops @ breakpoints added during runtime? doesn't happen other programs. 1 program has issue. of other programs i've ever debugged, able set breakpoints during runtime , debugger stops no problems. i using visual st...

java - String constructor to handle byte array producing weird result -

this question has answer here: what character encoding , why should bother it 3 answers i using implicit string constructor handle byte array..but results weird. have more proper output..? appreciated. here code.. byte[] arr = { 23, 34, 20, 65, 88, 95 }; string s1 = new string(arr); system.out.println("first: "+s1); string s2 = new string(arr, 1, 3); system.out.println("second: "+s2); it prints: first: ?"?ax_ second: ?ax the string() constructor using interpreting bytes in array according default character set java environment. can differ. if have specific character encoding want use, "us-ascii" or "utf-8", should specify character set using different constructor, such as: string(byte[] bytes, string charsetname) .

c++ multiple function on template? -

new c++ - kind of been cramming last few days. things going pretty well! have 1 question though. if make template: template <class t> t testfunc(t t1, t t2) { // code code code code } my question, template <> line specific 1 function underneath? couldn't continue use t placeholder in further functions i? like: template <class t> t testfunc(t t1, t t2) { // code code code code } t testfunc2(t t1, t t2) { // 1 other things....; } well when declare template <class t> t testfunc(t t1, t t2) this means declaring generic function "testfunc" takes class , works it. honest, don't know how can useful. if defining function in global namespace can use many template 's above functions like. in way connected. you can make generic class takes class template. way don't have write "template " above every single method in class. methods can take type t argument.

c++ - Rendering Object with Texture in OpenGL -

i'm trying put texture in model, doesn't work, model drawn without texture. this function loads texture, @ first should working fine, because used in program. i'm calling function @ main function putting result in global variable called modeltexture. gluint inittexture(char* filename) { bitmapinfo *info; glubyte *ptr, *bits, *rgba, *rgbaptr; gluint texture, temp; glenum type; bits = loaddibitmap(filename, &info); if (bits == (glubyte *)0) { return null; } if (info->bmiheader.biheight == 1) type = gl_texture_1d; else type = gl_texture_2d; glgentextures(1, &texture); glbindtexture(type, texture); gltexparameteri(type, gl_texture_mag_filter, gl_linear); gltexparameteri(type, gl_texture_min_filter, gl_linear_mipmap_linear); gltexparameteri(type, gl_texture_wrap_s, gl_repeat); gltexparameteri(type, gl_texture_wrap_t, gl_repeat); rgba = (glubyte *)malloc(info->bmiheader.biwidth * info->bmiheader...

Editor/IDE that can open random java source file and provide intellisense -

is there free editor/ide open random java source file , provide intellisense features? eclipse common free editor/ide requires create project first. you should not mix simple editors allow edit source files , full ide allow compile, run, test or debug full applications. in first category, find emacs, vim or notepad++ syntax highlighting. in second, have eclipse or netbeans. latter able edit random java file, if file imports non standard (jdk) modules, ide have difficulties find them.

javascript - Unable to add mp4 video to hd to sd flow player script -

i want use flow player script : sample i have 2 video 1 sd ( x.mp4 ) , second 1 hd ( x.hd.mp4 ) video i want same functionality need video only. bellow javascript code <script> flowplayer("httpstreaming-hd", " http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf ", { plugins: { f4m: { url: "flowplayer.f4m-3.2.10.swf" }, httpstreaming: { url: "flowplayer.httpstreaming-3.2.11.swf" }, // "tube" skin controls: { url: "flowplayer.controls-tube-3.2.16.swf"}, bitrateselect: { url: "flowplayer.bitrateselect-3.2.14.swf", // show hd button in controlbar hdbutton: { place: 'controls'}, // show selected file in content box // omitted in production onstreamswitchbegin: function (newitem, currentitem) { $f("httpstreaming-hd").getplugin('content').sethtml("will switch to: " + ...

sql - Error with nvarchar? -

i have created database error annoyed me , have tried every trick keeps coming back. works fine when add row or delete 1 one of tables don't rows when put n before dollarprice ok again when make changes tables same error occurs again have remove n works again. it's frustrating please help??? code below... dim cmd new sqlcommand("with tbl (select isnull(sum(case when paytype = 2 , currencytype = 1 " + "totalprice end), 0) [purchasetotald]," + "isnull(sum(case when paytype = 2 , currencytype = 2 " + "totalprice / n'" & dollarprice & "' end), 0) [purchasetotalid]," + "(select isnull(sum(case when currencytype = 1 amount end), 0) paycompany) [paycompanytotald]," + "(select isnull(sum(case when currencytype = 2 " + "amount / n'" & dollarprice & "' end), 0) paycompany) [paycompanytotalid]," + "(select isnull(sum(case when currencytype = 1 amount end), 0...

sql - GRANT user with select clause -

have 2 tables : applicant , applies //applicant a# ------------- 1 2 3 4 5 //applies a# position --------------------- 1 gm 2 ceo 3 director 3 manager so create user this: create user test identified testing; grant create session test; now want grant select test on table applicant have @ least 1 record in applies table using follow query: select a.a#,count(a.a#) applicant inner join applies ap on a.a#=ap.a# having count(a.a#)>0 group a.a#; how grant user test? select clause condition grant select on applicant (select.......) test; fail work, errors come out.

Why does "pi" become symbolic in MATLAB? -

in matlab command window type: syms f; s = 2*pi*f*j; s which returns s = pi*f*2*j why pi not calculated 3.141592...?what's wrong code entered command window? welcome symbolic math exact answers opposed floating-point approximations. if want "get number" can use non-symbolic functions , operations or can convert symbolic results floating-point. for example: syms f s = pi*f*2*j s2 = subs(s,f,2) s3 = double(s2) alternatively, can use variable precision arithmetic represent pi decimal approximation of specified level in symbolic expression: syms f s = vpa(pi)*f*j see documentation vpa further details. can use sym function achieve similar things. however, can lose of power of symbolic math if convert decimal or floating point representation soon. example, compare difference between following expressions: sin(pi) % 1.224646799147353e-16 sin(vpa(pi)) % -3.2101083013100396069547145883568e-40 sin(sym(pi)) % 0, sin(sym(1)*pi) , sin(sym(p...

openstreetmap - How can i use open street map in offline mode -

i able display map uses internet required <uses-permission android:name="android.permission.internet" /> permission. i don't want use this. want make project works offline. want display map stored in 1 of folders in project , display programmatically. it should offline, , should able zoom in/out. please share thoughts in this. thank you! please see offline openstreetmap in osm wiki. your question lacks lot of details. have decide whether want display pre-rendered tiles (images) or render own ones instead. have decide if need search function using geocoder nominatim , if need routing , if need meta information specific pois (addresses, opening hours, ...) etc.

Error in finding minimum element in perl -

i trying minimum , maximum element in array of elements in perl, every thing working fine minimum element not getting printed: @array1=(); $i=0; $array1[$i]=<stdin>; $sum=$minimum=$maximum=$array1[$i]; while($array1[$i]!=" ") { $i=$i+1; $array1[$i]=<stdin>; $sum=$sum+$array1[$i]; if($array1[$i]>$maximum) { $maximum=$array1[$i]; } if($array1[$i]<$minimum) { $minimum=$array1[$i]; } if($array1[$i]==" ") { last; } } print("entered numbers : ",@array1); print("sum of numbers : ",$sum); print "\n"; print("minimum number : ",$minimum); print "\n"; print("maximum number : ",$maximum); consider occurs when enter space in loop. assign $array1[$i]. check min , max. if have string , numeric comparisons, convert string number if can (such "12" 12). if have string not number (such space) convert 0. i s...

php - Codeigniter redirect in case of error on localhost -

i have installed wamp server on localhost. , created application using codeigniter framework. i using redirect(url) method in controller. if error found in same controller, page redirects url. on server not redirect , showing error. same functionality want on localhost. how achieve it? controller appointments extends ci_controller { function index() { load view } function save() { $customer_id=$c_id; //accessing undeclared variable $c_id error redirect(base_url("appointments")) } } in above code error been occured @ $customer_id=$c_id; rediection should prevented , error should shown. error shows when files on server not showing error on localhost. i got answer set output_buffering = off in php.ini file refere link php header location - not displaying error?

java - Maven/mvn warnings - It is highly recommended to fix these problems because they threaten the stability of your build -

this question not spring framework or j2ee such. as per book, have spring project in eclipse-jee. tells me build project maven. new maven , don't know doing it. so, used windows cmd project folder in eclipse , executed mvn package -dskiptests . now, succeeds build success message, gives me warnings given below. please tell me why warnings occur , how can ignorning warnings hurt me in future ? [info] scanning projects... [warning] [warning] problems encountered while building effective model com.perfmath.spring:soba:war:4 [warning] 'dependencies.dependency.(groupid:artifactid:type:classifier)' must unique: org.apache.httpcomponents:httpclient:jar -> version 4.1.2 vs 4.0.3 @ li ne 229, column 15 [warning] 'build.plugins.plugin.version' org.codehaus.mojo:tomcat-maven-plug in missing. @ line 46, column 12 [warning] [warning] highly recommended fix these problems because threaten t stability of build. [warning] [warning] reason, future maven versions mig...

Displaying content of div from the posts to the homepage on WordPress -

i have div in posts on wordpress: [div class="price"] $123 [/div] i display price within these divs on homepage, beside post titles. how possible? this shortcode using in wordpress theme. direct can't use beside post title. need programming tricks. alternate option apply css trick. [div class="price alternate_opt"] $123 [/div] note: not sure mightbe class="price alternate_opt" generate new class alternate_opt , apply css on class.

java - How can I get the workplace location path? -

i have tried getting project workspace absolute path, path through eclipse or tomcat.. need actual path project files located, such as: "c:\users\annie\workspace-java\professionalsweb" ('professionalsweb' project's name) or simplify question- path "webcontent" folder inside project in java workplace located. that why options not me: system.getproperty("user.dir"); getclass().getclassloader().getresource(".").getpath(); which give me: "c:\eclipse" "/c:/apache-tomcat-7.0.34/lib/" please me.. if need in servlet use getservletcontext().getrealpath("/")

C++ How send multiple values to two upper superclass? -

first of think factory system. create date class hold person's birthday , initial date work.e.g , have person class holds information person name, surname etc. , have department class , want initialize information person , department id , department name(name, surname..,birthday, initial work date ). created array in type of person in department header file. problem how can write deparment construct initialize attributes. no problem name, surname... date class requires 3 parameter. how can send there parameter other parameters department class? class date { int gun,ay,yil; public: int getday()const; int getmonth()const; int getyear()const; void set_day(int); void setmonth(int); void setyear(int); date(); date(int,int,int); virtual ~date(); } class deparment { int bolumid; string bolumname; static const int maxkisi = 10; person *personarray = new person[maxkisi]; static int counter; date datex,datey; public: int getb...

knockout.js - Change theme using knockout in asp.net on master page, change theme dynamically -

how can change theme dynamically using knockout in asp.net can change theme using app_theme folder on page_preinit method in cs file in app_code folder? i want change theme using knockout on master page.

php - Creating dynamic url doesn't work when using other variable than id -

i'm creating dynamic webpages website. i got archive.php file use following code: code archive.php: <?php (connect database) $id = $_get['id']; $sql = "select * `table-example` id = $id"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo $row['text']; }// end while }// end if else { echo '0 results';} ?> link dynamic page: <a href="/archive?id=<?php echo $row['id'];?>"> example of variable "id" in database: 123 result: when access page, opens http://example.com/archive?id=123 correct data. so far, good. problem want create url variable database. changed code this: code archive.php: <?php (connect database) $url = $_get['url']; $sql = "select * `table-example` url = $url"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo $row[...

css - Select child element of element with attribute -

i have button. button has span tag inside of text of button. button may disabled. when disabled, i'd button grey. why doesn't work? first html, css <button disabled> <span class="dark-disabled">start new game</span> </button> button:disabled span{ background: #ccc; } but fire if class selector instead: button:disabled .dark-disabled{ background: #ccc; } you looking css attribute selector button[disabled] span{ background: #ccc; } edit: i misread question, both :disabled , [disabled] work button. sample gave me works fine in firefox: jsfiddle what browser using?

php - SQL insert query loop -

hello doing school assigment have make comment system corresponding post id , know looping 3 times gave post id. , know postid changeing time. have no idea how fix bug ideas? <?php require_once("menu.php"); $connection = connecttomysql(); $selectpostquery = "select * (select * `tblposts` order id desc limit 3) t order id desc"; $result = mysqli_query($connection,$selectpostquery) or die("error in query: ". mysqli_error($connection)); while ($row = mysqli_fetch_assoc($result)) { $postid = $row['id']; if (!empty($_post['comment']) ) #to insert new comments in database { $comment = $_post['comment']; $userid = $_session['userid']; $insertcommentquery = "insert `tblcomments` (`content`,`userid`,`postid`,`timestamp`) values ('$comment','$userid','$postid',current_timestamp)"; $resultcomment = mysqli_query($conne...

ruby on rails - Error with Postgres Port when deploying to Herokuy -

i want deploy heroku have error: precompiling assets failed. note: i've put config.assets.initialize_on_precompile = false in application.rb it's still not working. `preparing app rails asset pipeline running: rake assets:precompile rake aborted! not connect server: connection refused server running on host "127.0.0.1" , accepting tcp/ip connections on port 5432? /tmp/build_9ff1fa36-2743-4f79-a9ac-62679367458b/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `initialize' /tmp/build_9ff1fa36-2743-4f79-a9ac-62679367458b/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `new' /tmp/build_9ff1fa36-2743-4f79-a9ac-62679367458b/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `connect' /tmp/build_9ff1fa36-2743-4f79-a9ac-6267936745...

Getting error using cor() in For loop in R for list of csv files -

i have list of csv files i'm iterating through corr <- function(directory) { filename <- list.files(directory) x <- paste(directory, "/", sep="") monitor_list <- paste(x, filename, sep="") completelocations <- null corrdata <- null i'm trying use cor() generate data frame has cor values 2 columns in each csv file. (monitor in monitor_list) { locationinfo <- read.csv(monitor) corrdata <- rbind(corrdata, cor(locationinfo$sulfate, locationinfo$nitrate, use = "complete.obs")) completelocations <- rbind(completelocations, sum(complete.cases(locationinfo))) } and throws error error in cor(locationinfo$sulfate, locationinfo$nitrate, use = "complete.obs") : no complete element pairs i know can done because when run exact same thing outside of loop, return correlation last csv file in list. print...

mysql - No Database Selected Php -

this simple task, trying compare username in database. testing out in single php file before properly. code below. have user, in database , checking if in there. <?php $db_connect = mysql_connect("127.0.0.1", "root", "anwesha01", "mis"); //check if connection worked. if(!$db_connect) { die("unable connect database: " . mysql_error()); } //for testing purposes only. else { echo "database connect success!"; } $user = "alj001"; $query = "select username `user` `username` = '".$user."'"; //what being passed through database. echo "<p><b>this being queried:</b> " . $query; //result if (mysql_query($query, $db_connect)) { echo "<br> query worked!"; } else { echo "<p><b>mysql error: </b><br>". mysql_error(); } ?> the result is: database connect success! this being...

html - I want to block the click scrool whell on mouse -

i have code, it's inframe position, srcooling blocked if click scrool wheel can move down, , want block this: <style type="text/css"> #outerdiv { width:550px; height:480px; overflow:hidden; position:relative; } #inneriframe { position:absolute; top:-412px; left:-170px; width:1280px; height:1000px; } </style> </head> <body> <div id='outerdiv'> <iframe src="http://minhateca.com.br/rubensgpl/filmes+avi/o+menino+do+pijama+listrado+dualaudio,20743425.avi" id='inneriframe' scrolling="no"></iframe> </div> i found scripts block don't know put inside in html. $(function() { $('body').mousedown(function(e){if(e.button==1)return false}); }); http://jsfiddle.net/pkpbn/3/ place javascript inside <head> tag inside of <script> tag follows. may work you: .... </style> <script src="your/path/to/jquery.js"></...

css - Padding-bottom/top in flexbox layout -

Image
i have flexbox layout containing 2 items. 1 of them uses padding-bottom : #flexbox { border: 1px solid red; width: 50%; margin: 0 auto; padding: 1em; display: flex; flex-direction: column; } #text { border: 1px solid green; padding: .5em; } #padding { margin: 1em 0; border: 1px solid blue; padding-bottom: 56.25%; /* intrinsic aspect ratio */ height: 0; } <div id='flexbox'> <div id='padding'></div> <div id='text'>some text</div> </div> the blue element maintains aspect ratio according width when page resized. this works chrome , ie , looks : however, in firefox , edge , following (it's ignoring padding on blue box, maintains aspect ratio): i'm new flexbox understand if should or shouldn't work. whole point of flexbox resize things, i'm not sure why ignoring intrinsic padding, , putting absolute sizes on blue element. i guess i...

java - How to access crawled content from nutch for content categorisation -

i running nutch integrated solr search engine, nutch crawl job happens on hadoop. next requirement run content categorisation job crawled content, how can access text content stored in hdfs tagging job, planning run tagging job java, how can access content through java ? the crawled content stored in data file in segments directory example: segments\2014...\content\part-00000\data the file type sequence file. read can use code the hadoop book or this answer

mysql - PHP Number Format with a calculation -

i still relatively new @ sorry if seems easy fix, doing calculation , want answer present 2 numbers after decimal. right giving me results above table , not replacing numbers in table. http://www.cnghl.biz/cnghldb/cnghlgoalieinfo.php?goalieid=71 this have set up print "<tr>"; print "<td><center>".$row['sea']."</center></td> "; print "<td><center>".$row['team']."</center></td> "; print "<td><center>".$row['gp']."</center></td> "; print "<td><center>".$row['min']."</center></td> "; $igaa = $row['ga'] * 60 / $row['min']; print $english_format_number = number_format($igaa, 2); print "<td><center>".$igaa."</center></td> "; print "<td><center>".$row['w']."</cent...

c++ - Refreshing the choices in a QComboBox used as an editor in a QTableView -

i'm using qcomboxbox in qtableview in qt. when add new row createeditor() of delegate called , can instantiate combobox correct set of choices available @ time. problem is, user can load different files outside table, , based on content of file combobox need updated items. there way can editor of cell, can update choices accordingly? since other cells of table should not destroyed, can not recreate table new data, need update comboboxes of cells. i've been looking in sourcecode of qabstractitemview , there function editorforindex() need, implemented privately inside view not accessible in derived class. of course can keep record of boxes create, can update them accordingly later on, wonder if there no other way of doing this. you can have contents of combobox class member of delegate in qstringlist . item delegate can : #include <qitemdelegate> #include <qcombobox> class comboboxdelegate: public qitemdelegate { q_object public: comboboxd...

javadb - java-How do i export data from a java db to a text file -

how can export data javadb ( found under services tab in netbeans) text file? i'm looking easiest possible code. (also want use code in jframe means of button).can please help. i think easiest way , best manually, read data db row row , write them txt file line line. don't think there tool or plugin that.

c# - scope of element names in XAML -

i'm trying name , set datacontext combobox that's embedded within itemscontrol. in main window, can access itemscontrol name not of elements within itemscontrol. public mainwindow() { initializecomponent(); slist.datacontext = app.sclist; //this valid sts.datacontext = app.stlist; //this not } and here's xaml code. can access slist within program not "sts" or "spanel1". compiler error is: "the name 'sts' not exist in current context" note i've tried both "name" , "x:name" <scrollviewer verticalscrollbarvisibility="auto" > <itemscontrol name ="slist" itemssource ="{binding}"> <itemscontrol.itemspanel> <itemspaneltemplate> <wrappanel margin="12"/> </itemspaneltemplate> ...

cordova - Adding hash key to Facebook Key Hashes -

i have signed app phonegap build , using fb connect once try login, facebook sends message invalid key hash. the key hash ### not match stored key hashes . when try add key hash on facebook developer page hash key not being validated in textfield. if add 1 letter hash it's validated , receives blue css label x mark. idea why hash not validated? thanks! here beautiful trick: the key hash ### not match stored key hashes. add = after key being shown facbook app. in case ###= you done!!

Infinite loop in PHP -

i working on project have random planning of 144 lawyers. planning per month.so on every day of month have 3-4 lawyers. planning made @ beginning on every month. planning must random , every people picked-up equally. my idea this: first time picked 4 people each day([144/31]=4) , remaining 20 planned on 01-20 may. there 4 plans , every lawyer choose on plan participate. in database store in table every option. example, if opts plan 1 ( called politie_parchet_all ), have 1 in table database). the problem here ...this code run if clause,and remaining 24 people remain non-selected.i think don't exit if clause , don't know why? $str_date ="01-".$luna."-".$an; $start_date = strtotime($str_date); $end_date = strtotime('+1 month',$start_date); $number_days = date("t",$start_date); $nr_lawyer =number_lawyer($planificare); while ($nr_lawyer >0) { $nr_lawyer =number_lawyer($planificare); if($nr_lawyer > $number_days) ...

html - Javascript For Loop keeps doubling up my divs -

i have written script creates number of fields based on number user inputs (k). i wrote script create correct number of fields. wanted arrange them vectors on screen, adapted script. i wanted following script create correct number of fields , place them in divs, lay them out wish on page. since doing this, script produces duplicate divs iff runs through loop twice, can't life of me work out why... function createfields(k) { k=k+1 (var n=1; n<k; n++) { var makebox=document.createelement("div"); makebox.id = "box" + n; document.getelementbyid("top").appendchild(makebox); document.getelementbyid("box" + n).setattribute('class',"box"); var addopen=document.createelement("div"); addopen.id = "open"+n; document.getelementbyid("box" + n ).appendchild(addopen); document.getelementbyid("open" + n).setattribute('class',"open"); ...