Posts

Showing posts from July, 2012

java - Why can't i instantiate ThreadPoolExecutor with BlockingQueue<Callable>; why only BlockingQueue<Runnable>? -

my understanding callable added in 1.5 , runnable interface kept as-is prevent world ending. why can't instantiate threadpoolexecutor (core, max, tu, unit, new blockingqueue<callable>()) - why queue take runnable only? internally, if submit, invokeall, invokeany callables, should fine right? also, shutdownnow() return list of callables? you can submit callables , wrapped internally runnables (actually futuretasks , implement runnable ). shutdownnow() going return runnables , says on tin. if want list of callables haven't been run, you'll need keep track of them somehow (e.g., keep list of them , make them responsible removing list when they're called.)

node.js - console output req.params in node/express -

when do: console.log(req.params), outputs: [ id: "param1" ] however when do, console.log("params:[%s]", req.params), it outputs [[]] i tried console.log("params:[%j]", req.params), console.log("params:[%s]", json.stringify(req.params)), console.log("params:" + req.params), with output not expected. what wrong here?` try require('util').inspect() method formatting. format calling method changed in 0.10.0, depending on version of node in have use different node doc. here links pre , post 0.10.0 version of function. http://nodejs.org/docs/v0.8.25/api/util.html#util_util_inspect_object_showhidden_depth_colors http://nodejs.org/docs/v0.10.13/api/util.html#util_util_inspect_object_options so, like: console.log( require('util').inspect( req.params ) );

c# - When I run application by installer, I am getting error as "Bad method token. " -

i working on c# windows form application. when run application through code works fine. creating installer of application. obfuscating exe. when installed installer , run application getting error as: "bad method token." stack strace : @ system.runtime.compilerservices.runtimehelpers.preparedelegate(delegate d) @ system.appdomain.add_unhandledexception(unhandledexceptioneventhandler value) @ jb80w1fe10kqfu9dubj.irnkuefzdyqqy76x09t..ctor(exportfilteroptions , boolean ) any on issue appreciated. this type of error related obfuscation problems, if calling method in .dll through invokemember . things try: as test, don't obfuscate , see if fixes problem. if so, know obfuscator-related. try different obfuscator. quality varies pretty greatly, 'community' , 'free' ones. commercial obfuscator production builds. as test, try without installer. installers put files in unexpected places can lead runtime errors. ma

datasource - Excel creates new sheet from invisible data in pivot table cell -

i have been sent pivot table in excel 2010, , data in cell linked data not visible on of sheets when double clicked. when cell clicked on new sheet created data not visible on sheet. however, when use pivot table tools search data source leads me data in 1 of visible sheets , not allow me click on external data source section. create this/ understand how cells simultaneously linked, not understand data relevant cell. my hunch have selected calculated field (select pt, pivottable tools > options > tools - formulas, list formulas). in other words, are able see relevant source data in spreadsheet not recognising not familiar because formula in pt has combined or modified data. note, above based on excel 2007 however.

objective c - CCMenuItemLable don't run block or selector -

i'm trying use ccmenuitemlabel, when press nothing happens. have menu item sprite works same code. any idea? ccmenuitemlabel *milabel = [ccmenuitemlabel itemwithlabel:tmplabel target:self selector:@selector(dosomethingtest)]; milabel.tag = tmptag++; __block nsstring *actionname = [menuitemdata objectforkey:kactionname]; [milabel setblock:^(id sender) { aslog2debug(@"[test]"); [self handlepressformenuitemwithactionname:actionname]; }];

xslt - (Umbraco) Can get text but not image from a subnode to homepage -

i'm trying text , image articles in subsection "featured" (home/featured/article1, 2,...,n) don't image. code works fine getting text every article inside 'featured' node. <xsl:if test="position() &lt; $maxitems"> <h3><a href="{umbraco.library:niceurl(@id)}"> <xsl:value-of select="newstitle"/> </a> </h3> <strong><xsl:value-of select="intro"/></strong> <br/> <small> a: <xsl:value-of select="umbraco.library:formatdatetime($currentpage/@updatedate, 'mmmm d, yyyy')"/> por: <xsl:value-of select="author"/> </small> </xsl:if> it works fine. cannot images article. i'm trying way, among others: <a href="{umbraco.library:niceurl(@id)}"> <xsl:if test="count(./* [@isdoc]) > 0">

python - Why are os.system and subprocess.call spawning so many processes? -

import os import subprocess import sys import re ## fname_ext=sys.argv[1] fname_ext=r"c:\mine\.cs\test.cs" exe=os.path.splitext(fname_ext)[0]+".exe" # executable fdir=os.path.split(fname_ext)[0] fcontent=open(fname_ext).read() p_using=re.compile("\s*using\s+((\w+[.]*)+)") p_namespace=re.compile("\s*namespace\s+(\w+)") usings=p_using.findall(fcontent) usings=[x[0] x in usings] references=[] in os.listdir(fdir): path=fdir+"\\"+i try: if os.path.isdir(path) or (not path.endswith('cs')):continue open(path) fp: content=fp.read() namespaces=p_namespace.findall(content) n in namespaces: if n in usings , 'system' not in n: references+=[path] except: pass command="csc /nologo "+" ".join(references)+" "+fname_ext ## command=" ".join(references) #~ -------------------------------

javascript - Rally waspi queries - filter using 'in' operator -

i trying of user stories associated given rollup querying first features have rollup parent, , finding of stories have feature portfolioitem parent. however, requires messy looping in order loop on of features children. have been using multiple wsapi data stores queries, , want use of syntax lbapi queries - particularly, can use 'in' value operator? tried doing array of ids supplied, did not appear work. more elegant (and easier) like filters : [{ property : 'parent.objectid', operator : 'in', value : ids }] rather than ext.array.each(ids, function(id) { ... filters : [{ property : 'parent.objectid', operator : '=', value : id }] or unique lbapi? going in entirely wrong way? thanks it possible use 'in' operator snapshotstore ,which retrieves data lookback api, in example below, 1111 , 2222 oids of portfolioitems of type theme: ext.create('rally.data.loo

jquery human triggered events - event.pageX and event.pageY are undefined -

i have mouseenter event attached element working fine. same event, triggering event manually using jquery.trigger("mouseenter"). calling mouseenter handler. in event object, event.pagex , event.pagey undefined. there way it? created sample - here you can use mousemove handler keep track of current mouse position. can pass x , y .trigger() , passed handler.

Why are my COMMITs after SELECT-only transactions slow with PostgreSQL? -

i have web app presenting data that's being generated separate process , stored in postgresql, version 8.4. backend writing continuously, majority of views in web app execute nothing read-only select queries. according new relic python agent, 30% of view processing time spent waiting commits complete, , it's particularly bad in views issued lot of select queries, if didn't modify data. i expected transaction had been read-only have little work during commit phase. postgres doing during commit on these read-only queries? i know turn off synchronous_commit these transactions hide latency view, , don't care durability read-only transaction, don't see why should necessary, , i'm concerned doing might mask deeper misconfiguration. there various clean operations need done keep database in shape, , many of these done first process stumbles upon opportunity, if process doing select queries. these clean operations can generate wal records, trigger

sql server 2008 r2 - Msg 102, Level15, State 1, Line 16 INSERT based on SELECT -

i have looked @ various other posts error message , tried solutions. nothing seems fix problem. post pretty describes i'm trying do; want create new shop in database same fields existing shop. this code. insert [dbo].[elementdescriptions] ( [fieldname] , [displayname] , [required] , [datatype] , [sortorder] , [elementid] , [description] , [lookup] , [uitype] , [requiredfornew] , [requiredforreconditioned] , [requredforsecondhand] , [shopcode]) select ([fieldname] , [displayname] , [required] , [datatype] , [sortorder] , [elementid] , [description] , [lookup] , [uitype] , [requiredfornew] , [requiredforreconditioned] , [requredforsecondhand] , 'newshop') [dbo].[elementdescriptions] [aarshopcode] = 'oldshop' my error says it's near ','. you shouldn't have parentheses around select list. insert dbo.table(columns) select (columns) ... should be: insert dbo.table(columns) select columns ... ----------------------

php - How can two scripts use the same port at the same time? -

i'm trying set "server" script in php, should run limited amount of time in background. multiple instances of script may run @ same time. unfortunately fsockopen() doesn't let me use same port @ same time 2 different scripts, others fail in error :( is there way around this? php doesnot support multi-threading , there alternatives it, not best in slang word- "workable". and listen on specific port using php , use socket_listen , socket_bind , socket_create , etc., functions of php, may have on stream_select functions too... if helps. recommended page parallel processing in php

common lisp - sbcl - how to muffle "undefined variable" warning? -

i can't figure out how sb-ext:muffle-conditions . want this: (declaim #+sbcl(sb-ext:muffle-conditions sb-kernel:redefinition-warning)) except want muffle "undefined variable" warning instead of redefinition, of course. if knows parameter or has link documentation/various options sb-ext:muffle-conditions , please share :) thanks i'm not sure whether you'll able muffle type of warning specifically, @ least class name. tracing warn , can idea of sbcl doing. instance, happens in redefinition case: * (trace warn) (warn) * (defun foo () nil) foo * (defun foo () nil) 0: (warn sb-kernel:redefinition-with-defun :name foo :new-function #<function foo {10041fa989}> :new-location #s(sb-c:definition-source-location :namestring nil :toplevel-form-number nil :plist nil)) style-warning: redefining common-lisp-user::foo in defun 0: warn returned nil foo warn getting called class

Remove line break HTML -

i'm wondering how remove line break in html. example code have 2 hello worlds on top of each other. i'm sorry if i'm not enough @ programming in site. <p>hello world</p> <p>hello world</p> you've got few options: p { display: inline-block; } js fiddle demo . or: p { display: inline; } js fiddle demo . if it's white-space between bottom of first p , top of second p want remove: p { /* top right bottom left */ margin: 0 0 0 0; } js fiddle demo .

ruby on rails - Calling a method on User in application_helper.rb returns undefined method -

i'm trying write helper method converts floats imperial metric. have following method in application_helper.rb: module applicationhelper def weight_conversion_factor if user.measurement_units == 'metric' 0.453592 elsif user.measurement_units == 'imperial' 1 end end end if call current_user.measurement_units in view, works great. when try call user.measurement_units in application_helper.rb file, undefined method measurement_units' #` what missing here? shouldn't able call measurement_units on user within applicatoin_helper? measurement_units field in user table. thanks! user class, not instance. use current_user in helper method too: module applicationhelper def weight_conversion_factor return nil if current_user.nil? if current_user.measurement_units == 'metric' 0.453592 elsif current_user.measurement_units == 'imperial' 1 end end end

php - Programmatically check Enterprise WSDL against Salesforce -

i'm building custom salesforce integration php application using php sdk , soap api. have enterprise account. my company changes custom objects inside of salesforce. i'm worried might break integration our salesforce account. there way verify programmatically wsdl (generated inside salesforce) still working? i tried using describeglobal message, seems reflect what's inside current wsdl (rather checking salesforce). since company changes custom objects should using partner wsdl, not enterprise. enterprise used non changing or changing orgs. basically, typed wsdl. partner loosely typed can access objects within org , gain flexibility requires more time development. if didn't want stop using enterprise wsdl, use both. use partner issue describeglobal call detect changes, download new wsdl, compile , need it.

php - Communication between the two servers to transfer data -

why can not establish connection!! how create relationship between 2 tables in 2 database on separate server information in fact, want records table in second server , insert server in table table selection correct:site1.com.class.users this code: $conn_server1=mysql_connect("site1.com","user","pass"); $db_server1=mysql_select_db("class",$conn_server1); $conn_server2=mysql_connect("site2.com","user","pass"); $db_server2=mysql_select_db("class",$conn_server2); $result=mysql_query("select * site2.com.class.users site2.com.class.users.mobile not in(select mobile form site1.com.class.users)",$conn_server1); while(mysql_fetch_assoc($result)) mysql_query("insert site1.com.class.users(name,family,phone1,phone2,mobile) select name,family,phone1,phone2,mobile site2.com.class.users",$conn_server1); site2.com.class.users",$conn_server1); you trying select data connec

html - createElement and appendChild in JavaScript -

i trying figure out why createelement , appendchild aren't working. believe i've got code correct i'm not sure why it's not working... (i using ie 10) code updated javascript file: var myobj = { firstname: "john", lastname: "smith" }; html file: <!doctype html /> <html> <title>the data structure</title> <body> <script type="text/javascript" src="thedata.js"> var theelement = document.createelement('p'); var thetext = document.createtextnode(myobj.firstname); theelement.appendchild(thetext); document.body.appendchild(theelement); </script> </body> </html> the issue both supply src on script tag and provide content within it. that's invalid, can 1 or other, not both. browsers use src , disregard content. separate that, creating element doesn't put in dom. have add somewhere (via appendchild or insertbefore or similar). s

regex - Find and replace comma-separated strings to Cassandra list format in VIM -

i convert comma-separated string quoted "" such following: "hello,world,stack,overflow" into following cassandra list format using vim: "['hello','world','stack','overflow']" where each element embraced '' , whole original string embraced "[]" . can know how should in vim? in input, such comma-separated string quoted "" part of csv formatted row. below example: other,fields,123,456,"hello,world,stack,overflow" second,row,567,890,"another,comma,separated,string" ... and transform into: other,fields,123,456,"['hello','world','stack','overflow']" second,row,567,890,"['another','comma','separated','string']" ... and each of target strings won't across multiple lines. try this :%s/\v(".*)@<=\s*([^,"]+)\s*(.*")@=/'\2'/g :%s/"/&q

etl - Programmatic data conversion strategy -

i have product imports data files clients (ie: user directories, etc), , export other types of data (ie: reports, etc). import , exports in in csv format (rfc4180), , files passed , forth through managed file transfers. increasingly, i'm seeing requests clients transform , reconfigure these data files use in legacy systems. import data files, it's bizarre requests like: "we're passing 20 columns, apply $business_logic columns 4,7,5,18,19 determine actual value system needs in column 21, drop original columns cuz aren't useful themselves" or "the value in column 2 padded zeros, please strip off." for data exports files, it's requests like: "you sending .csv, need in our special fixed width format." or "you formatting numbers decimals. remove those, , prefix 8 zeros." of course, every client onboard has different requirements. i'm hesitant dive in , write scratch imagine there sort

google chrome - Image Resizing on Different Browsers -

i'm trying make website , works fine on browsers google chrome , safari, doesn't work on mozilla firefox , internet explorer. here's link how looks http://imgur.com/bmmoqw0,qiicbr4#0 first image how looks in chrome , safari. second link ie , firefox. the html square image wrapped in many borders. <div> <div> ... <div> <img> </div> ... </div> </div> the css has image , divs set border-radius 100% , has code along lines of: max-width: 574px; max-height: 574px; display:block; max-height:100%; //repetitive, know, i've been frustratingly trying might work width:auto; max-width:100%; height: auto; i've tried max-height, without max-height, height: 100%, without height: 100%, etc. i've googled problem countless times , solutions work others don't seem work me. i've set html, body {height: 100%} , i've tried .cycle-slide {width:100%;} , section img { width: 100% } didn't work either.

Magento "visible" config key not recognized in EAV custom attribute -

i using getdefaultentities() function run installer script. works, of attribute config keys reflect in attributes section of admin. "visible," "visible_on_front" , of other properties not work @ all. custom attribute set not visible, not visible on front end. can spot doing wrong? class ia_advancedshipping_model_resource_eav_mysql4_setup extends mage_eav_model_entity_setup { /** * @return array */ public function getdefaultentities() { return array( 'catalog_product' => array( 'entity_model' => 'catalog/product', 'attribute_model' => 'catalog/resource_eav_attribute', 'table' => 'catalog/product', 'additional_attribute_table' => 'catalog/eav_attribute', 'entity_attribute_collection' => 'catalog/product_attribute_collection', 'attributes'

ruby on rails - how to specify the view or controller for running javascript 'document.ready' -

i want run javascript bellow when page loaded. $ -> $.getjson '/memos.json', (data) -> $.each( data ), (key,memo)-> $('#memos').append( "#{memo.title} #{memo.content}<br/>") but want run after 'users/show.html.erb' loaded. view bellow <div id="memos"></div> i think there 2 approaches this. 1 specify views loaded, , second 1 specify controller. i don't think writing javascript on erb file idea. there way implement them? thanks. the $ -> .. on first line, translated $(function() { ... }); which shorthand jquery's $(document).ready(function() { ... }); which means script inside of function executed once dom ready. so save javascript separate file let js/memos/index.js , within view app/views/memo/index.html.erb' have the ` , on same file can include javascript javascript include tag. the javascript executed once dom ready, meaning @ point hav

mysql - Comments to every post (PHP) -

sorry if being such noob! i'm working on blog page posts. have set cms can create new posts (with following method..) if(isset($_post['submit'])) { if(isset($_post['postname'])) { if(isset($_post['postcontent'])) { addpost($_post['postname'],$_post['postauth'],$_post['postcontent'],$_post['postcats'],$_post['postday'],$_post['postmonth'],$_post['postyear'],$_post['postimage'],$post_count); header("location: addpost.php"); } else { "text empty"; } } else { echo "title empty"; include('back1.php'); } } else { header("location: back2.php"); } function addpost($pname, $pauth, $pcontent, $pcat = 1, $pday, $pmonth, $pyear, $pimage) { $query = mysql_query("insert posts values(null,'$pname','$pauth',

android - Airplane mode verification No class Def -

this code generates following error. know why? thanks! java.lang.noclassdeffounderror: android.provider.settings$global @suppresslint( "newapi" ) @suppresswarnings("deprecation") public boolean isairplanemodeon(context context) { if(build.version.sdk_int >= build.version_codes.jelly_bean){ return settings.global.getint(context.getcontentresolver(), settings.global.airplane_mode_on, 0) != 0; //<--error here } else { return settings.system.getint(context.getcontentresolver(), settings.system.airplane_mode_on, 0) != 0; } } you should check following: if(build.version.sdk_int >= build.version_codes.jelly_bean_mr1){ because class introduced in api level 17 build.version_codes.jelly_bean_mr1. alternatively do: if(build.version.sdk_int > build.version_codes.jelly_bean){

runtime error: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver -

i new mysql , jdbc , getting error in title. have been searching day , cannot find solution works me. what have tried: uninstall/reinstall mysql, copy paste mysql-connector-java-5.1.25-bin.jar , ojdbc7.jar same location .class file trying run, rebuilt program in different directory, , couple other things. i using notepad++ coding , windows command prompt compile , run. compiles fine try run with c:\projects\bin>java -cp . clientbase the output is: java.lang.classnnotfoundexception: com.mysql.jdbc.driver at java.net.urlclassloader$1.run(urlclassloader.java:336) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) @ java.lang.classloader.loadclass(classloader.java:432) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308) @ java.lang.classloader.loadclass(classloader.java:356) @ java.

linq to xml - XDocument replace all node value with lower case -

i need make values within xdocument lower case. what's best way of doing this? to clarify, want change text values, without specifying names of nodes. you like: doc.document .descendantnodes() .oftype<xtext>() .tolist().foreach(x => x.value = x.value.tolower());

user interface - Python GUI - Insert text to text box -

i got python guis , testing different things, since seems me learn easier (trial , error). 1 thing trying inserting message different class. can say, don't know use for, trying sake of trying. # hello world # displays "hello world!" in text box. tkinter import * class myclass(object): def mymethod(): print("hello world!") class application(frame): """ gui application can reveal secret of longevity. """ def __init__ (self, master): super(application, self).__init__(master) self.grid() self.createwidgets() def createwidgets(self): # create text box self.txtbox = text(self, width = 300, height = 300, wrap = word) self.txtbox.grid(row = 0, column = 0, sticky = w) # display message message = myclass.mymethod self.txtbox.insert(0.0, message) # main root = tk() root.title("my title") root.geometry("500x500") a

java - ListView in javafx, adds multiple cells -

debugging code below, shows updateitem() method called multiple times, unable figure out why being called multiple times. i wanted add tooltip listview. // add tooltip, not working fully. lstcomments.setcellfactory(new callback<listview<string>, listcell<string>>() { @override public listcell<string> call(listview<string> p) { final tooltip tt = new tooltip(); final listcell<string> cell = new listcell<string>() { string message = ca.getmessage(); @override public void updateitem(string s, boolean empty) { super.updateitem(s, empty); tt.settext(message); settooltip(tt); } }; cell.settext(ca.getmessage()); return cell; } }); recommendation i find usability of tooltips on listview cells horrible, because tooltips intercept standard mouse events used select rows, scroll list, etc.

groovyshell - Syntax error in removing bad character in groovy -

hello have string a= " $ 2 187.00" . tried removing white spaces , bad characters a.replaceall("\\s","").replace("$","") . getting error impossible parse json response: syntaxerror: json.parse: bad escaped character how remove bad character in expression value becomes 2187.00.kindly me .thanks in advance def = ' $ 2 187.00' a.replaceall(/\s/,"").replaceall(/\$/,"") // or a.replaceall(/[\s\$]/,"") it should return 2187.00 . note that $ has special meaning in double quoted strings literals "" , called gstring . in groovy, can user regex literal, using better using regex multiple escape sequences in string.

virtualbox - How to access webmin (and httpd) inside virtual box -

i have centos inside virtual box. gave 2 network connections. 1 set nat, other set host-only. i can ping inside virtual box host. can ping host centos inside virtual box. i have installed webmin , https in centos. can open webmin , php script inside virtual box. can't open both of them host. any help? i solved problem telling firewall allow ports (10000 , 80).

Jquery: how to trigger click event on pressing enter key -

i need execute button click event upon pressing key enter. as @ moment event not firing. please me syntax if possible. $(document).on("click", "input[name='butassignprod']", function () { //all action }); this attempt fire click event on enter. $("#txtsearchprodassign").keydown(function (e) { if (e.keycode == 13) { $('input[name = butassignprod]').click(); } }); try out this.... $('#txtsearchprodassign').keypress(function (e) { var key = e.which; if(key == 13) // enter key code { $('input[name = butassignprod]').click(); return false; } }); $(function() { $('input[name="butassignprod"]').click(function() { alert('hello...!'); }); //press enter on text area.. $('#txtsearchprodassign').keypress(function(e) { var key = e.which; if (key == 13) // enter key code { $('input[name = butassi

node.js - npm install zmq issue -

i doing npm install zmq stuck in strange error, please see below c:\users\administrator>npm install zmq msbuild : error msb4132: tools version "2.0" unrecognized. available ls versions "4.0". gyp err! stack error: c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe failed exit code: 1 gyp err! stack @ childprocess.onexit (c:\program files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:267:23) gyp err! stack @ childprocess.eventemitter.emit (events.js:98:17) gyp err! stack @ process.childprocess._handle.onexit (child_process.js:789: 12) googled no luck. fresh install on windows server 2012. , zmq installed using windows msi installer, want use zmq under nodejs doing npm. think msbuild failing node assuming version 2 of .net framework, installed .net version 4. can 1 please guide me how solve issue - thanks regards zishan right, gustav, solved installing visual studio 2012. first changed .net version 4

php - How to store the the value of a text box in a database? -

what want achieve: in html window click button, popup window opens containing text box , submit button. there enter text text box, , after click submit button text should stored using sql in database. i have code (see below)to text box value, , call script store value in database. my ajax code $(document).ready(function() { $("#sub").click(function() { $.ajax({ type: "post", url: "jqueryphp.php", data: { val: $("#val").val() }, success: function(result) { $("div").html(result); } }); }); });​ html form code <input type="text" name="val[text]" id="val"/><br> <input type="button" name="sub" value="submit" id="sub"/> how can put these pieces together? you can use html form this: <html> <head> <script type="text/javascript&qu

Start Activity Android with class name -

i using following code start setting want launch setting activity started android ins packagelist allowedappspackagename=callhelper.ds.getpackagelist(); packagemanager manager = calldetectservice.packagemanager; intent mainintent = new intent(intent.action_main, null); mainintent.addcategory(intent.category_launcher); final list<resolveinfo> apps = manager.queryintentactivities(mainintent, 0); collections.sort(apps, new resolveinfo.displaynamecomparator(manager)); final int count = apps.size(); resolveinfo info=new resolveinfo();; gridviewapplist.clear(); (int = 0; < count; i++) { info= apps.get(i); if(info.activityinfo.applicationinfo.packagename.contains("setting")) break; } applicationinfo application = new applicationinfo();

java - Using third party libraries with netbeans -

Image
i new java. trying use jsoup in small project. couldn't set netbeans use it. i have opened folder third party libraries in c:\users\muhammed\jarlibraries , have put jsoup-1.7.2.jar in it. right clicked on libraries , selected add jar folder. project looks this; as can see image above, netbeans cannot resolve jsoup when fix imports. doing wrong here? how process work? why placed libary package? thats not how that. instead: go project properties right clicking on project. then click on libraries tab, see compile, run, compile tests, run tests tabs. click on compile tab (the first tab, selected default) click on add jar/folder button @ right then browse , select jar file(not folder) want include. included jar file show on following box of compile tab. click on ok button. finished. than added project , classpath. you imported complete folder project, have single jar file.

eclipse - RuntimeError for SDL2 after installing pySDL2 -

i installed pysdl2 0.4.1 by: downloading source package, entering python setup.py install . tried run copypasted pydev eclipse "the pong game: getting started" tutorial code example: import os, sys try: os.environ["pysdl2_dll_path"] = "/home/me/workspace/pong/third-party" print(os.getenv("pysdl2_dll_path")) sdl2 import events, sdl_quit import sdl2.ext sdl2ext except importerror: import traceback traceback.print_exc() sys.exit(1) def run(): sdl2ext.init() window = sdl2ext.window("the pong game", size=(800, 600)) window.show() running = true while running: events = sdl2ext.get_events() event in events: if event.type == sdl_quit: running = false break window.refresh() return 0 if __name__ == "__main__": sys.exit(run()) i got following error: traceback (most recent call last): file "/ho

php - How to hide a DIV if title contain stop word -

i want hide div wordpress theme, when stop word appear in post title. <?php if (in_category('10')) { ?> <div id="adsense-top">the adsense code</div> <?php }else { ?> <?php } ?> + <div id="adsense-bottom">the adsense code</div> - manually inserted basically, need remove 2 divs post when word present in title. here simple way acheive in javascript . <script type="text/javascript"> var title = document.title; //title of page returned if(title.indexof('stop') !== -1) { //if not found, return -1 document.getelementbyid('adsense-bottom').style.display = 'none'; } </script> but in php , need like <?php if (in_category('10')) { ?> <div id="adsense-top">the adsense code</div> <?php }else { ?> <script type="text/javascript"> var title = document.title;

linux - couchdb exited: app_would_not_start,public_key -

i'm getting couchdb error, , literally cannot find documentation anywhere! looks might ssh problem, don't quite see how. curious if knows error or how diagnose it? =info report==== 10-aug-2013::12:37:17 === application: couch exited: {{app_would_not_start,public_key}, {couch_app,start, [normal, ["/home/me/etc/couchdb/default.ini", "/home/me/etc/couchdb/local.ini"]]}} type: temporary couchdb.stderr shows output right away when trying run it: heart_beat_kill_pid = 1028162 heart_beat_timeout = 11 heart_beat_kill_pid = 1046062 heart_beat_timeout = 11 heart_beat_kill_pid = 5462 heart_beat_timeout = 11 heart_beat_kill_pid = 354270 heart_beat_timeout = 11 couchdb version 1.1.1 erlang r15b gnu/linux i had couchdb working, ran problems intermittently shut down every couple of hours/days, tried upgrade erlang newest since couchdb.stderr file seemed pointing finger @ erlang. after

openedge - Learning Progress 4GL -

i have job interview on monday (wahey!) role of trainee programmer. on job description, knowledge of "progress 4gl" desired not essential. maximise chances of getting job, have taken upon myself learn of basics of progress 4gl. however, despite googling have found nothing expensive books , little/no tutorials on topic. have searched openedge abl research far suggests new name language. my question is: is there free, online tutorial teaches basics of progress 4gl/openedge abl, aside documentation available on progress website? you can request trial download @ progress software . primary sources of information 1) progress communities . see psdn -> documents can download complete documentation in pdf format or read online. 2) progress software knowledgebase i think if read of documentation psdn, starting abl essentials @ least know exists , looks if you're not familiar working it. (by way progress changed name of language progress abl couple o

php - Exit current command in cmd.exe -

it stupid question, main reason cant find answer dont find best keywords put in search engines. when write command example: php app/console , , command not giving result, how can come command line (exit current command)? how can go main command line (c:/xampp/htdocs)? try ctrl+c, both on mac , pc

php - Writing a SQLite db loaded using :memory to disk -

i'm generating quite substantial (~50mb) sqlite3 database in memory need able write disk once generation of said database complete. best way of approaching using php? i have tried creating structurally identical sqlite3 db on disk, , using inserts populate it, far slow. have drawn blank looking @ online php sqlite3 docs . what have found sqlite3 backup api , not sure how best approach interfacing php. ideas? the backup api not available in php. if wrap inserts single transaction, speed should ok. you avoid separate temporay database , make disk database fast increasing page cache size larger 50 mb, disabling journaling , , disabling synchronous writes .

javascript - how to pass java script value to php in codeigniter -

i have form 2 fields dynamically generated through java script when button clicked.when button clicked each time,the 2 text field generate again , again.now have got count of text field generated in hidden field in javascript.how can value of hiddenfield in controller , insert values of text fields in database,by appending comma in data when text box value entered each time.please me. my javascript is <script> var countbox=0; var textbox1=0; var textbox2=0; function getfield() { var newtextbox1="name1"+countbox; var newtextbox2="name2"+countbox; document.getelementbyid('renderdiv').innerhtml+='<br/><input type="text" id="'+newtextbox1+'" name="'+newtextbox1+'" /><br/><input type="text" id="'+newtextbox2+'" name="'+newtextbox2+'" />'; document.getelementbyid('renderdiv').innerhtml+='<br/><input type=&qu

ruby - Reduce size of text_field on a form in rails and bootstrap -

i'm newbie , i'm developing app rails , bootstrap. i'm using generate field on form: <%= d.text_field :email, :placeholder => "email" %> <%= text_field_tag 'doctor[name][]', nil, :placeholder => "name" %> and works want resize height of it. googled , didn't found answer fits. does faced issue? if you're using bootstrap v2, should add this: <%= d.text_field :email, :placeholder => "email", :class => "span5" %> note number in span class referred size want put. if you're using new bootstrap (v3 rc), should check this page

forms - joomla module on submit refresh page -

i have following situation joomla 2.5 have 2 modules on page 1. in first module have form submit itself, sets registry variable. (use setuserstate) 2. in second module read registry variable , update view accordingly, (use getuserstate) the problem is, when first module submits, update self, not page or other module. how can force update on entire page, or atleast notify other module read registry variable.

android - When I try to call LocationClient.connect(), I got NumberFormatException -

i download project example google(locationupdates.zip, http://developer.android.com/training/location/retrieve-current.html ). when ran it, showed exception follows, not always: 08-10 16:10:34.119: w/system.err(26914): java.lang.numberformatexception: invalid int: "" 08-10 16:10:34.127: w/system.err(26914): @ java.lang.integer.invalidint(integer.java:138) 08-10 16:10:34.127: w/system.err(26914): @ java.lang.integer.parseint(integer.java:359) 08-10 16:10:34.127: w/system.err(26914): @ java.lang.integer.parseint(integer.java:332) 08-10 16:10:34.127: w/system.err(26914): @ java.util.calendar.gethwfirstdayofweek(calendar.java:807) 08-10 16:10:34.127: w/system.err(26914): @ java.util.calendar.<init>(calendar.java:745) 08-10 16:10:34.127: w/system.err(26914): @ java.util.gregoriancalendar.<init>(gregoriancalendar.java:338) 08-10 16:10:34.127: w/system.err(26914): @ java.util.gregoriancalendar.<init>(gregoriancalendar.java:325) 08-10 16:1

jvm - What is the maximum of number of arguments for varargs in java? -

what maximum of number of arguments can used vararg in java ? believe there should limit , not infinite. a method (including static class initializer) can have @ 64k. if arguments such can pushed single bytecode 1 byte long each, can have 64000 arguments on call.

java - Custom CellEditor with JScrollPane - start editing issue -

i have jtable custom celleditor using jtextarea inside jscrollpane. works when enter edit mode via mouse clic. however, when try type letter while cell focused, nothing happens. cell gets "edit mode style" (the background changes), stays empty... any idea ? public class multilinecelleditor extends defaultcelleditor { jtextarea textarea; jscrollpane scrollpane; public multilinecelleditor( final jtable table ) { super( new jtextfield() ); getcomponent().setname( "table.editor" ); setclickcounttostart( 2 ); textarea = new jtextarea(); scrollpane = new jscrollpane(); scrollpane.setviewportview( textarea ); editorcomponent = scrollpane; }//end multilinecelleditor public component gettablecelleditorcomponent( jtable table, object value, boolean isselected, int row, int column ) { this.setvalue( value ); scrollpane.se

asp.net mvc - Image showing in attachment instead of mail body -

i have problem embedded image in email. when receiving mail show image in attachment instead of message body , have add image dynamically in message body. , have set "cid" have not success. have set ishtmlbody = true not showing image in body. please solve problem. my code here: this body message: const string = "test@gmail.com"; msg.to.add(to); msg.from = new mailaddress("test@gmail.com"); msg.subject = "test"; int count = 1; int stratindex = 0; //create altenative view alternateview alternative = alternateview.createalternateviewfromstring(strmailcontent, null, mediatypenames.text.html); while ((lastindex = strmailcontent.indexof(findstr, stratindex, stringcomparison.ordinal)) != -1) { int srcstartindex =convert.toint32(strmailcontent.indexof("src", lastindex, stringcomparison.ordinal)) + 5; int srcendindex = strmailcontent.inde

regex - PHP strip all brackets from string -

this question has answer here: remove text between parentheses php 7 answers my php script calls freebase api , outputs string can contain number of open closed brackets. each set of open closed brackets can contain number of open closed brackets itself. example; $string = "random string blah (a) (b) blah blah (brackets (within) brackets) blah"; how can use php , regex manipulate string resulting in output doesn't contain contents of brackets or brackets themselves? example; $string = "random string blah blah blah blah"; you can use recursive regex: $result = preg_replace('/\(([^()]*+|(?r))*\)\s*/', '', $subject); explanation: \( # match ( ( # match following group: [^()]*+ # either number of non-parentheses (possessive match) | # or (?r) # (recursive) match of current regex )*

osx - Creating zip with __MACOSX/.DS_Store from a non-mac system -

there plenty of questions , answers how ignore __macosx/.ds_store files created mac os x... i know how go other way, , include __macosx/.ds_store files, when working zip files created on platform. zipping file structure not enough; seems there kind of hidden flag in zip file marking part of file structure in zip mac resource fork. creating resource fork on other platform isn't issue, i'm trying generate zip file includes existing resources. thoughts? need create own zip tool?

java - Variable Number of Nested For Loops -

i'm making word unscrambler in java. right have program can print rearrangements of 3 letters chosen word 3 or more letters (no repeats). example, if parameter abcd , print this: [[abc, abd, acb, acd, adb, adc, bac, bad, bca, bcd, bda, bdc, cab, cad, cba, cbd, cda, cdb, dab, dac, dba, dbc, dca, dcb]] i'm filling 2d array list permutations. right 2d array has 1 array inside of it, contains permutations 3 letters. want 2d array have arrays permuations of 1 letter, 2 letters, 3 letters, , on, stopping @ length of word. problem need variable number of nested loops accomplish this. 3 letter permutations, have 3 nested loops. each 1 cycles through letters in parameter. public static void printallpermuations(string word) { int len = word.length(); arraylist<string> lets = new arraylist<string>(); //this array of letters allows easier access //so don't have keep substringing (int = 0; < len; i++) { lets.add(word.substring(i,