Posts

Showing posts from September, 2011

c# - How to share data between two Windows Form in Visual Studio 2008 -

m beginner n want help i have 2 forms form1 form2 form1 contains label, textbox, button. form2 contains textbox only. i want when click on button in form1 , text in textbox (form1 textbox) should pass form2 , show in textbox of form2 . code form1.cs public partial class form1 : form { public string str; public form1() { initializecomponent(); } public class global { public static string str; } private void form1_load(object sender, eventargs e) { } private void button1_click(object sender, eventargs e) { str = textbox1.text; } private void button2_click(object sender, eventargs e) { form2 f2 = new form2(); f2.show(); } } code form2.cs public partial class form2 : form { public form2() { initializecomponent(); } private void form2_load(object sender, eventargs e) { string str1 = form1.global.str; textbox

Decrypting PHP aes encryption in javascript -

i've been programming years now, never had encryption/decryption. so i've got following php: function base64_url_decode($input) { return base64_decode(strtr($input, '-_,', '+/=')); } function aesdecrypt($phrase, $user_key){ $key = pack('h*', $user_key); $ciphertext_dec = base64_url_decode($phrase); # may remove 00h valued characters end of plain text $plaintext_dec = mcrypt_decrypt(mcrypt_rijndael_128, $key, $ciphertext_dec, mcrypt_mode_ecb); return $plaintext_dec; } echo aesdecrypt( "-gzmiqhjynzw0fxtr6qolrypnlgcscbfgznmzga35tydoznwskwdxvietqwjhjigcydvvkb0lbkutx-txxhniqn680mziz8lg7hntmgprxm,", "2dd9bb29d2e25c18bdc12d7b75f6f5d0ef3d99ef310a0319e2796bb30278b24c557f78b6c958faa55d70ce081f2607a0e62b9fa01e2483f9a75b032b7fd9678c" ); the output of 1kyjjuajo8bilst5cvcsqygld_dqx-fjuihkefzfjouii7nx29ietz8qwtvih6yx5ui, i've created js fiddle simulate have in ja

xml and include and then xslt 2.0 -

i have 3 xml files, need xslt 2.0 1 file. parts of same book chapter. can have xslt see them 1 file ? (eg. include?). easier write xslt template trick. xml has inclusion mechanisms external entities e.g. <!doctype root [ <!entity chapter11 system "chapter1-1.xml"> <!entity chapter12 system "chapter1-2.xml"> <!entity chapter13 system "chapter1-3.xml"> ]> <root> <chapter> &chapter11; &chapter12; &chapter13; </chapter> </root> or xinclude. depends on xml parser use or can plug chain of tools use xslt processor. within xslt can of course e.g. <xsl:template match="/"> <xsl:apply-templates select="(doc('chapter1-1.xml'), doc('chapter1-2.xml'), doc('chapter1-3.xml')//p"/> </xsl:template> without need have xml parser support inclusion mechanism.

java - javafx tableview how to get selected data without using class -

i working on javafx project , want selected data tableview don't want use class because number of columns not fixed .so, please me. for example: public static class identifiedname { private final int id; private final string name; private identifiedname(int id, string name) { this.id = id; this.name = name; } public int getid() { return id; } public string getname() { return name; } } this class can use 2 column table , in project client can add column per need please me selected data tableview more code here: import java.sql.connection; import java.sql.resultset; import java.util.map; import javafx.application.application; import javafx.beans.property.simplebooleanproperty; import javafx.beans.property.simplestringproperty; import javafx.beans.value.changelistener; import javafx.beans.value.observablevalue; import javafx.collections.fxcollections; import javafx.collections.observablelist; import ja

android - how can I get the value from programmatically radio button/check box? -

i have form question comes web service (maybe have check boxes or text field or radio button-made programmatic-ally ) , send value local database. first part (call web service , showing them) correct second part (getting values) not! how can value programmatic-ally radio button/check box ? (the important part have 2 "for" radio button or check boxes) i not know how can value!??!??! code, made question! plz me. for (int = 0; < output2.length; i++) { if (output2[i].contains("#")) { part1 = output2[i].split("#"); int i2 = 0; { // question id ->part1[0] // fk_masternazar ->partinfo_id[0] // tilte ->part1[1] textview tv2 = new textview(page2.this); tv2.setid(i2); tv2.settext(part1[1]); tv2.setgravity(gravity.right); lmain2.addview(tv2); // answers ->part1[2] // type ->part1[3] switch (integer.valueof(part1[3])) { case 1: // single selection part2 = part1[2].split(","); radiogroup1 = new radiogroup(page2.this); radiogroup

java - Why does my simple timer app keep getting faster each time I pause? -

ok, thought problem each time press stop , start, new runnable created, have multiple runnable running @ same time, updating timer quicker , quicker each time. doesn't seems problem: changed code adding boolean "running" pressing start/stop changes boolean variable. in way, think 1 runnable running. still gets faster click start/stop several times in row. can tell me problem is? package com.example.timernew; import android.app.activity; import android.os.bundle; import android.os.handler; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.textview; public class mainactivity extends activity { handler h=new handler(); textview t; button start, stop,reset; boolean running; runnable run=new runnable() { @override public void run() { updatetime(); } };; @override protected void oncreate(bundle savedinsta

python - PyCharm: debugging line by line? -

i using pycharm (community version) python ide. want program debug in line-by-line fashion. don't want set every line break point... there way this? as @cyber mentioned, debugging hotkeys let step through line line, step down function calls, etc., once you've hit breakpoint , stopped somewhere. if want step through each line, set breakpoint somewhere @ beginning of code. if you're using main() function in code, e.g.: def main(): .... if __name__ == '__main__': main() # breakpoint here, 'step inside' go next line then set breakpoint @ call main() . (if you're not, might want try approach.) one other thing i'd point out pycharm's easy-to-overlook feature of conditional breakpoints . if right-click on breakpoint symbol in gutter area of editor, can type in condition, n > 10 ; breakpoint triggers when line executed , condition met. when you're trying debug code issues within recursive functio

Jquery UI generated on the fly is not working -

i have jquery ui sliders different data-id. how possible detect selected , return sliders value in span next it? i generate sliders , other elements dynamicaly: <script> $(function() { $( "#slider" ).slider({ value:100, min: 0, max: 50000, step: 50, create: function () { $(this).slider( "option", "value", $(this).next().val() ); }, slide: function( event, ui ) { //get id of slider var id = $(this).data('id'); //select input box has same id slider within , set it's value current slider value. $("span[class*=" + id + "]").text(ui.value); //$("div[class*=" + id + "]").val(ui.value); } }); }); </script> <script> $(document).ready(function() { $("#adding").click(function() { var intid = $("#buildyourform div").length + 1; var fieldwrapper = $("<div class=\"fieldwrapper\" id=\"field" + intid + "\&q

unity3d - "Undo" after editing objects in a custom editor -

i've made custom editor (extends editorwindow). editor allows edit selected objects. the problem after press button on editor panel, pressing ctrl / cmd + z does nothing, it's not tracked in history. is there command enable trace actions triggered within custom editor panel? you can since unity doesn't automatically keeps track of objects modified scripts, have inform editor object record. can rely on unity's undo system serialized properties. the steps are: use undo.recordobject track object before modifying it modify serializedproperty of object use editorutility.setdirty flag object modified here's simple example: public class testwindow : editorwindow { static transform anobjtransform; void ongui() { anobjtransform = editorguilayout.objectfield ("selected object", anobjtransform, typeof(transform), true) transform; if (anobjtransform != null && guilayout.button("move right"

Rails Masonry GEM issues with Bootstrap Tab-pane -

i'm using bootstrap tab-pane inside of rails application. inside of each tab want use masonry gem. however, items stacking on top of eachother. .container %ul.nav.nav-tabs - if @project.user == current_user %li %a{href: new_project_room_path(@project)} <i class='fa fa-plus-circle'></i> add room - @rooms.each |room| %li %a{"data-toggle" => "tab", href: "##{dom_id(room)}"}= room.title .tab-content - @rooms.each |room| .tab-pane{id: dom_id(room)} .container-fluid.page.page-block .masonry-container.centered.transitions-enabled.infinite-scroll.clearfix - room.products.each |product| .box.col3 = product.title if resize page, display side side, way want them to. how can display time? also fyi, when use similar code not inside of tab-pane, works fine. .container-fluid.page.page-block .masonry-container.centered.t

email attachments - PHPMailer - How do I unlink files in temp dir.? -

i looping through files array shown in middle chunk of code, rest of code better context. $email = new phpmailer(); $email->from = 'john@example.com'; $email->fromname = 'john doe'; $email->subject = $name_talent; $body = '<strong>address</strong> : ' .$address_talent.'<br><br>'; if ($_files) { foreach ($_files $file => $array) { $tmp_path = $_files[$file]['tmp_name']; $tmp_name = basename($_files[$file]['name']); $email->addattachment($tmp_path, $tmp_name); } } $email->body = $body; $email->ishtml(true); $email->addaddress( '#####@gmail.com' ); $email->send(); this sends attachments values in $body well. now, unlink files either after mail sent or attachments successful. inspired from answer , if below, no files attached , variables set $body eg. $address_talent do not appear in email. if ($_files) { foreach

html - PHP is only submitting the last selection of a multi selection drop-down menu -

i newbie php, , don't know doing wrong or if have done correct, seems working, drop-down menus aren't working. the $selectthree , $selectfour shows last selection... example if picked dropdown option , b... b show in email... i.e: name: name number: number date: 10/06/2014 select: dropdowna select2: dropdowna select3: drop down option b select4: drop down option b radio: female checkbox: optionb switch: on email: example@example.com message: message php: <?php session_start(); if ($_server['request_method'] == 'post'){ ob_start(); if(isset( $_request['name'], $_request['email'], $_request['message'], $_request['number'], $_request['date'], $_request['select'], $_request['selecttwo'], $_request['selectthree'], $_request[&#

c++ - Wrong answer while calculating the nth root of number in cpp -

i calculating n'th root of positive integer using standard library method pow() .here snippet program : double x,y; x=pow(64,(1.0/3)); int z; printf("x=%lf\n",x); z=(int)x; printf("%d\n",z); but while finding cube root of 64. x printed 4.000000 while z 3. why ? can suggest better algorithm , same ? if print more digits on x , you'll see problem (i chose 30 randomly): double x ; x = pow(64, 1.0/3); printf("x=%.30lf\n",x); output: x=3.99999999...999600000000 so obvisouly, if cast x int became 3 . there not 'perfect' solution. if you're dealing integer, create own root function, if want able use float, you'need deal accuracy problem due floating point representation. there maybe c libraries kind of problems.

javascript - Converting a newline from JS to HTML with Node.js -

supposing have object data defined follows: res.render('index', { data: 'line one\nline two' }); how can render value in html (by using jade template engine) splitting text on 2 lines? note: using \<br\> instead of \n , still doesn't work. try res.render('index', { data: 'line 1 <br/> line two' }) and in index.jade != data

c++ - MFC Overlay Child Window Effect -

Image
i want know there solution discovered in mfc far , can give child window following overlay effect: where "before closing regclean pro " child window of main window in background . there way achieve such effect in mfc?

java - How can I use CssResources in UiBinder a generated Cell? -

i want generate cell cellwidget uibinder (uirenderer). did generate cell in mycell.java : public class mycell implements abstractcell<mydto> { public interface resources extends clientbundle { @source({css.default_css }) css css(); } public interface css extends cssresource { string default_css = "test/mystyle.css"; string test(); } interface myuirenderer extends uirenderer { void render(safehtmlbuilder sb, string name, safestyles styles); } private static myuirenderer renderer = gwt.create(myuirenderer.class); resources resources = gwt.create(resources.class); @override public void render(safehtmlbuilder safehtmlbuilder, mydto model) { safestyles style = safestylesutils.fromtrustedstring(resources.css().test().tostring()); renderer.render(safehtmlbuilder, model.getname(), style); } } my mycell.ui.xml file looks this: <!doctype ui:uibinder system

gradle - Method must be overridden in [proguard.optimize.peephole.ClassMerger] if ever called” in Android Studio -

seen @ least 2 similar questions, both considering eclipse non gradle builds. i'm trying assemble release gradle using: ./gradlew myapp:assemblerelease --stacktrace besides newest google proguard example proguard.txt contains: # butterknife -keep class *$$viewinjector{} -dontwarn butterknife.views$injectviewprocessor -dontwarn butterknife.internal.** #jodatime -dontwarn org.joda.time.** #apache -dontnote org.apache.** -dontwarn org.apache.** this seemed remove warnings struggling mysterious caused by: java.lang.unsupportedoperationexception: method must overridden in [proguard.optimize.peephole.classmerger] if ever called ...and have no clue means. i had same issue , never discovered root of issue. did find if add rule skip optimization in proguard file stops build error happening. -dontoptimize

visual studio - Monotouch - add files to your bundle with a build action -

i add dll files application bundle build action. possible? if give me example how can it? thanks in advance! you can add library projects main app's solution, when build app libraries rebuilt necessary. alternatively, use post-build action in library project copy library dlls folder (a library folder, or project folder app) app reference them.

python - Google App Engine SDK Fatal Error -

i installed python 3.4 on mac (os 10.9.3) , command running google app engine terminal via /usr/local/dev_appengine stopped working. (stupidly) did rather arbitrary things online forums , google app engine stopped working well. when open it, says: sorry, pieces of googleappenginelauncher.app appear missing or corrupted, or can't run python2.5 properly. output was: i have tried delete application , related files , reinstall, nothing has worked me. fails make command symlinks when try run terminal /usr/local/bin/dev_appserver.py: no such file or directory. app engine not support python 3.x. still have 2.x installed? go google app engine launcher > preferences, , make sure have proper python path v2.x. should "/usr/bin/python2.7" from terminal, type whereis python find it. if know using version 2.7, try: whereis python2.7

frameworks - Use Bourbon with Bitters and Neat -

i want use bourbon neat , bitters next project. have installed 3 have no idea how proceed. do use 3 folders separately in project folder or need add different imports _bourbon.scss have imports in 1 main file? for instance, there button.scss, clearfix.scss , hide-text.scss in bourbon (in addons) , bitters (in extends) folder, aren't these going conflict when used together? all appreciated :) you have import files of plugins (bourbon, neat , bitters) 1 main file. button.scss, clearfix.scss , hide-text.scss won´t conflict. this how organize project im working on: - project |--css |--base //(bitters) |--bourbon |--neat |--application.sass |--application.css |--js |--img |--index.html in application.sass initial code: @import 'bourbon/bourbon' @import 'base/base' @import 'neat/neat' so import bourbon, bitters , neat in main .sass file can start using them. can start changing default settings in base/_var

How to automate read.csv command in R? -

i'm doing stupid , cannot read.csv write lot of files. if write: write.csv(x1, file = "x1.csv") then writes ~2mb csv file ok. have around 2000 variables in memory , i've tried for (i in seq_along(fotos)) { write.csv(paste("x", i, sep = ""), file = paste(paste("x", i, sep = ""),"csv", sep="."))} i obtain desired files files ~2kb , x1.csv contains 1 cell saying "x1.csv", , all files similar because x1000.csv contains "x1000.csv", unlike command write.csv(x1, file = "x1.csv") creates file x1.csv containing matrix of 96x96. any idea of i'm doing wrong? many in advance. you can object name function get . however, better read data frames list objects related having common names. so can create list of data frames: x <- lapply(seq_along(fotos), function(i) get(paste0("x", i))) names(x) <- fotos and write them (and you'd use if had

python - Error starting mod_wsgi -

when run start-server command on mod_wsgi-experess, output: server url : http://localhost:8000/ server root : /tmp/mod_wsgi-localhost:8000:0 server conf : /tmp/mod_wsgi-localhost:8000:0/httpd.conf error log : /tmp/mod_wsgi-localhost:8000:0/error_log httpd: syntax error on line 2 of /tmp/mod_wsgi-localhost:8000:0/httpd.conf: module version_module built-in , can't loaded the line 2 in httpd.conf in tmp folder referring says following. automatically created mod_wsgi: loadmodule version_module '/usr/local/apache/modules/mod_version.so' i stumped. ideas how on obstacle? i can change how generated configuration done, can indicate linux distribution version of apache using supplied on, or if compiled yourself. can provide output in question running: httpd -m change 'httpd' in command whatever apache installation has called main apache http server executable if has been changed. right generated configuration expects using apache

java - Am I referencing this library wrong? -

this library i'm trying use in app: https://github.com/rampo/updatechecker i downloaded zip, unzipped it, imported android project, marked library, , added list of libraries going properties of app folder. getting error: the container 'android dependencies' references non existing library 'c:\users\jake\downloads\updatechecker-master\updatechecker-master\library\src\main\bin\updatechecker.jar' what doing wrong? i'm using eclipse btw. do want use library? (not editing source) if so, can copy .jar file 'libs' folder inside project c:\path\to\workspace\myproject\libs

translation - How to make ngettext() works using the php-gettext library? -

i using php-gettext library . following tutorial here , have set _gettext() function require_once("locale/gettext.php"); require_once("locale/streams.php"); $locale_file = new filereader("locale/$locale/lc_messages/messages.mo"); $locale_fetch = new gettext_reader($locale_file); function _gettext($text){ global $locale_fetch; return $locale_fetch->translate($text); } i want use ngettext() function translate plural texts. not work. how can that? thanks! ok found it function _ngettext($t1, $t2, $count){ global $locale_fetch; return $locale_fetch->ngettext($t1, $t2, $count); }

winapi - C++ - Create dialog box containing buttons and static text on click -

so project follows last question. implemented buttons , found out how render events when clicked, question next-step me struggling with. utilizing winapi want create dialog box when button clicked on window class, want dialog box take properties of window class can pass specific properties it. how approach this? again, demo code appreciated! taking time.

java - How to decompress a RAR file in Android application with out of memory exception? -

i writing android application decompressing rar files of junrar library. during decompression of type of rar files, out of memory exceptions occur. could please me resolve issue. i know, there problem junrar library, if found solution, please let me know. my analysis: if rar file compressed ppm algorithm, out of memory exception occurs because attempt made allocate more memory android device vm has. startsuballocator allocating more memory android vm has new byte [100] mb bytes. exceeds available ram of 96 mb of android vm. logs attached java.lang.outofmemoryerror com.github.junrar.unpack.ppm.suballocator.startsuballocator(suballocator.java:146) com.github.junrar.unpack.ppm.modelppm.decodeinit(modelppm.java:216) com.github.junrar.unpack.unpack.readtables(unpack.java:656) com.github.junrar.unpack.unpack.unpack29(unpack.java:165) com.github.junrar.unpack.unpack.dounpack(unpack.java:120) com.github.junrar.archive.doextractfile(archive.java:500) com.github.junrar.arc

javascript - how to create json object in angular js -

this.addtocart = function(id,name,category,price) { alert(id+"name"+name); var eachproduct = [ { "name": name, "id": id, "category":category, "price":price } ]; alert(eachproduct.name);//i getting undefine addedproductslist.push(eachproduct); sessionstorage.setitem("addedproductslist", addedproductslist); return "success"; }; how pass function parameters each product? as abdul has pointed out have json array , want json object, there need var eachproduct = { "name": name, "id": id, "category":category, "price":price }; now alert(eachproduct.name); return name. , assume "how pass function parameters each product"

android - How to draw a path on pdf canvas by using itext pdf? -

i implementing pdf editing application using itextpdf. added text pdf , drawing name on android system canvas using canvas.drawpath() method.like want draw names on pdfcanvas possible?. i tried of example drawing curves , rectangle on pdf canvas not giving exact solution.for drawing curves on pdf canvas using "pdfcontentbyte".in class found of methods curvefromto(x1,y1,x3,y3) curveto(x2,y2,x3,y3) curveto(x1,y1,x2,y2,x3,y3) in methods using curvefromto() after saving it's giving mirror path not original path. means if draw pdf on android canvas rotating mirror image. is possible draw path on pdf file.and there method canvas.drawpath(); first things first: there no canvas.drawpath() method in itext. now rest of question: there methods draw text on pdf page using low-level functionality , methods draw text using high-level functionality. at lowest level, 1 use, sequence of begintext() , setfontandsize() , settextmatrix() , showtext() , endtext()

wordpress - How to set get_the_excerpt() limit word in shordcode -

i want limit words in shortcode. i'm trying made wp plugin here need limited words get_the_excerpt{(); functions. php has many ways : place in functions.php: function excerpt($num) { $limit = $num+1; $excerpt = explode(' ', get_the_excerpt(), $limit); array_pop($excerpt); $excerpt = implode(" ",$excerpt)."... (<a href='" .get_permalink($post->id) ." '>read more</a>)"; echo $excerpt; } then, in theme, use code <?php excerpt('22'); ?> limit excerpt 22 characters. other way : <?php echo substr(get_the_excerpt(), 0,30); ?> enjoy!!

java - Making Spring Data JPA work with DataNucleus (GAE) (Spring Boot) -

there several hints spring data works google app engine like: http://tommysiu.blogspot.com/2014/01/spring-data-on-gae-part-1.html http://blog.eisele.net/2009/07/spring-300m3-on-google-appengine-with.html much of examples not "spring boot" i've been trying retrofit things it. however, i've been stuck error days , days: [info] caused by: java.lang.nullpointerexception [info] @ org.datanucleus.api.jpa.metamodel.singularattributeimpl.isversion(singularattributeimpl.java:79) [info] @ org.springframework.data.jpa.repository.support.jpametamodelentityinformation.findversionattribute(jpametamodelentityinformation.java:102) [info] @ org.springframework.data.jpa.repository.support.jpametamodelentityinformation.<init>(jpametamodelentityinformation.java:79) [info] @ org.springframework.data.jpa.repository.support.jpaentityinformationsupport.getmetadata(jpaentityinformationsupport.java:65) [info] @ org.springframework.data.jpa.repository.support.jpareposito

datetime - Time Difference in PostgreSQL -

i need time 1 hour earlier current time in postgresql. for example, if time 15:01:06, want result 14:01:06. how can achieve in postgresql? will work select now()-interval '1 hour';

.net - Missing Type error on internally hosted Nuget site -

i'm trying fix issue local nuget repository (on azure vm). working has been giving following error: the type 'microsoft.visualstudio.diagnostics.servicemodelsink.behavior, microsoft.visualstudio.diagnostics.servicemodelsink, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' registered extension 'microsoft.visualstudio.diagnostics.servicemodelsink.behavior' not loaded. checking in gac, assembly not seem present. error follows server migration installed on previous machine not installed on new machine. nuget site works fine on local dev machine. does know be? implications of removing references assembly machine.config? not sure caused removed references servicemodelsink in machine.config , works.

c - Record add/show/delete for file functions not working -

the question's title pretty explains situation. not used using files , associated commands (such fseek, fwrite, etc). anyhow, following program must simulate menu, , present user choice of either adding, editing, deleting or showing records file. rather simplistic task, can't figure out i'm doing wrong. #include <stdio.h> typedef struct{ int code; char description[100]; int volume; }product; int main() { int pick =0, i; product *p; file *fileptr; void add(file *fileptr, product* p); void removal(file *fileptr, product* p); void show(file *fileptr, product* p); void edit(file *fileptr, product* p); void description(file *fileptr, product* p); if ( ( fileptr = fopen( "stock.dat", "rb+")) == null ) { printf("the file not read"); } else { do{ printf(" ************ main menu ************\n"); printf(" ** -------------welcome------------- **\n"); printf(" **

Does Javascript have something like Ruby's method_missing feature? -

in ruby think can call method hasn't been defined , yet capture name of method called , processing of method @ runtime. can javascript same kind of thing ? the ruby feature explaining called "method_missing" http://rubylearning.com/satishtalim/ruby_method_missing.htm . it's brand new feature present in browsers firefox (in spider monkey javascript engine). in spidermonkey it's called "__nosuchmethod__" https://developer.mozilla.org/en/javascript/reference/global_objects/object/nosuchmethod please read article yehuda katz http://yehudakatz.com/2008/08/18/method_missing-in-javascript/ more details upcoming implementation.

c++ - What is the difference between those ways to create an object? -

i have class name type. difference between: 1. type t=a; 2. type t(a); where 'a' variable. and difference between: 3. type t; 4. type t(); thank you. edit: there answers contradict each other. has final answer? type t=a; this copy initialization (§8.5/15). requires type has non- explicit constructor taking argument of whatever type a is, or type a implicitly convertible to. type t(a); this direct initialization (§8.5/16). t can constructed argument a if corresponding constructor explicit . type t; t default initialized (§8.5/12). type t(); this function declaration function named t returns type value (§8.5/11).

python - Sklearn, gridsearch: how to print out progress during the execution? -

i using gridsearch sklearn optimize parameters of classifier. there lot of data, whole process of optimization takes while: more day. watch performance of already-tried combinations of parameters during execution. possible? set verbose parameter in gridsearchcv positive number (the greater number more detail get). instance: gridsearchcv(clf, param_grid, cv=cv, scoring='accuracy', verbose=10)

logparser - Adding an extra column to log parser results -

how add column specified value log parser results? thanks in advance! just add select clause: select field1, field2, 'this fake column' myfield3 ...

jsp - How to make the page load an error page after the tomcat session timeout? -

Image
i need provide user error page after tomcat session time out. handle created filter , added logic detect , after saying go error page. public void dofilter(servletrequest arg0, servletresponse arg1, filterchain chain) throws ioexception, servletexception { m_log.debug("startfilter"); httpservletrequest request=(httpservletrequest)arg0; httpservletresponse response=(httpservletresponse)arg1; string title = request.getparameter("context_title"); tcsessiondata tcsession = (tcsessiondata) request.getsession.getattribute("tcsessiondata"); if((title!=null && tcsession==null) || (title==null && tcsession!=null) ){ chain.dofilter(request, response); }else if(title==null && tcsession==null) { //response.sendredirect("/error/error.jsp"); request.getrequestdispatcher("/error/error.jsp").forward(request, response); } } after session times out see going

javascript - how to make block diagram of ul and li in jquery? -

i trying make block diagram of ul , li in jquery ? found 1 solution , modified , exact result want . http://jsfiddle.net/5wsc5/ or in example there nested ul , li anchor tags .it show sow block diagram of that. but apply concept in example (having ul , li no anchor tag) .it fail make block .i remove anchor tag css. http://jsfiddle.net/zw9pb/ can please tell wrong .? /*now css*/ * {margin: 0; padding: 0;} .tree ul { padding-top: 20px; position: relative; transition: 0.5s; -webkit-transition: 0.5s; -moz-transition: 0.5s; } .tree li { float: left; text-align: center; list-style-type: none; position: relative; padding: 20px 5px 0 5px; transition: 0.5s; -webkit-transition: 0.5s; -moz-transition: 0.5s; } /*we use ::before , ::after draw connectors*/ .tree li::before, .tree li::after{ content: ''; position: absolute; top: 0; right: 50%; border-top: 1px solid #ccc; width: 50%; height: 20px; } .tree li::after{

c# - OleDbConnection. How to determine is it HTML (Web Page) document or Excel document -

i have program, parses excel documents , binds gridview in asp.net using oledbconnection . connectionstring = string.format("provider=microsoft.ace.oledb.12.0;data source={0};extended properties=\"excel 12.0; hdr=no;\";", filepath); also has option parse web page oledbconnection, in case import document web page throws exception " external table not in right format " or kind of. connectionstring = string.format("provider=microsoft.ace.oledb.12.0;data source={0};extended properties=\"html import; imex=1;\";", filepath); this connection string web page. if try parse excel document provide same exception (see above). so how determine type of file get, when of them have same extension (.xls or .xlsx)? in first case use 1 connection string, in second case - connection string.

c++ - How can i use libboost1.54-all-dev:amd64 and I386 together? -

i have c++ program needs program_options library libboost package. i installed boost sudo apt-get install libboost1.54-all-dev , compiled program with g++ program.cpp -m64 -static -lboost_program_options -o compiled/program.out . everything worked fine. then wanted compile 32bit used -m32 instead of -m64 . it said: /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../libboost_program_options.a when searching -lboost_program_options /usr/bin/ld: skipping incompatible /usr/lib/libboost_program_options.a when searching -lboost_program_options /usr/bin/ld: cannot find -lboost_program_options collect2: error: ld returned 1 exit status then used google , found, have install boost i386 package compiling i386 applications. seems, cant install amd64 , i386 same time. when try install i386 apt-get want remove amd64 packages , when try amd64 i386 removed. i can compile apps in i386, have install i386 , reinstall amd64... hope can me this! thankyou!

PHP Solarium - Composer Autoload giving class not found errors -

i'm trying solarium running on centos 6.5 rpm install of php (5.3.3) , apache httpd. i have followed instructions on website, creating folder /var/www/php (which in include path in php.ini) , downloading composer. i've entered following composer.json: { "require": { "solarium/solarium": "3.*" } } and run "php composer.phar install". i trying run examples in solarium examples folder (specifically 1.1 solr ping example). have amended init.php include line: require('vendor/autoload.php'); i have confirmed vendor/autoload.php being run adding print statement it. however, when run example get: fatal error: class 'solarium_version' not found in /var/www/html/test/1.1-check-solarium-and-ping.php on line 7 or if comment out line 7: fatal error: class 'solarium_client' not found in /var/www/html/test/1.1-check-solarium-and-ping.php on line 10 so seems solarium files not bei

html - How to say that you need to turn your mobile phone in javascript/css? -

i have website wich can view on horizontal way. don't know how block if vertical. can't figure out... can me this? you can in css hiding/showing dependant on orientation <style type="text/css"> #warning-message { display: none; } @media screen , (orientation:portrait){ #wrapper { display:none; } #warning-message { display:block; } } @media screen , (orientation:landscape){ #warning-message { display:none; } } </style> .... <div id="wrapper"> <!-- html website --> </div> <div id="warning-message"> website viewable in landscape mode </div> source forcing web-site show in landscape mode only