Posts

Showing posts from August, 2014

excel vba - Automatic Macro for every sheet -

excel vba - Automatic Macro for every sheet - i have method formattong excel sheet problem have 14 sheets , auto_open method working in sheet1 only? is there way run method run everysheet automatically when open excel? the best create function or sub called every "onopen" events of sheets. excel-vba

vb.net - Check file against multiple extensions? -

vb.net - Check file against multiple extensions? - i'm wondering if possible check if file matches list of set extention. @ moment have working code checks file see if has .txt .jpg or .mp3 example if (path.getextension(f).tolower() = ".txt") ' it's .txt file ' msgbox("i txt document") b.image = my.resources.text_img elseif (path.getextension(f).tolower() = ".jpg") b.image = my.resources.img_img else b.image = my.resources.folder_img end if this code set image shortcut. want able check if file matches more txt .doc .log video types mp4 avi mpg. sound types mp3 ogg flacc acc tried, failed elseif (path.getextension(f).tolower() = ".jpg" & ".png" & ".jpeg" & ".tiff") b.image = my.resources.img_img end if is possible don't want add toget

design - How to use Android asset studio for action bar? -

design - How to use Android asset studio for action bar? - as provided in link http://romannurik.github.io/androidassetstudio/index.html how utilize zip folders created site styling purpose....?can 1 provide detailed step wise procedure add together generated folder action tab. create new android project (make sure target sdk @ to the lowest degree 3.x or 4.x) use new android project wizard create project similar 1 in preview on site (in other words, project actionbar , tabs). or @ listing of projects on this app , import 1 of actionbar projects there. make sure initial project wizard works intended. go ahead , run @ to the lowest degree 1 time before add together else. download generated zipped folder site unzip it cut , paste resulting res/ folder in root of project (to replace current res/ folder). if there file name conflicts, allow files you're cutting , pasting overwrite existing file names. look within main activity/fragment setcontentview(), name

Select price range in Page Monitor with Regex (Addon Chrome) -

Select price range in Page Monitor with Regex (Addon Chrome) - i installed addon chrome called "page monitor" alerts when website changes. difficulty alert when specific happens using regex. (also can done in "selector" think more difficult) the addon looks that: i have insert code regex there. have been learning regex several tutorials in spanish or english, still have doubts. what want observe if cost in specific range. for example, if take cost range between $ 0.00 , $ 50.00, tool must warn me when cost $ 45.00, doesn't when cost $ 55.00. the website has many prices. i tried utilize i've learned, doesn't seem work: <\b^[0.00-50.00]> could help me find solution? if asking regex match strings "$ 45.22", "$21.12", "$09.99" or "$ 2.30" , while not matching these $50.00, $ -12.00, $ 5, $ 49, $ 100.00 , next 1 job: \$ ?[0-4]?\d\.\d\d however, have consult addon man

Neo4j 2.1.2 incremental backup fails but full backup succeeds -

Neo4j 2.1.2 incremental backup fails but full backup succeeds - we upgraded our database 2.0.1 2.1.2 (enterprise) using explicit upgrade procedure. when trying take backup post-upgrade, total backups succeed, incremental backups fail. when running command first time, succeeds: ~/neo4j-enterprise-2.1.2/bin/neo4j-backup -from single://127.0.0.1 -to /mnt/backups/neo4j-test-backup running sec time gives next error: performing backup '127.0.0.1' 00:18:44.907 [main] info o.n.k.internalabstractgraphdatabase - no locking implementation specified, defaulting 'forseti' transactions applied exception in thread "main" org.neo4j.consistency.consistencycheckingerror: inconsistencies in transaction: start[3,xid=globalid[neokernl|2772027681176372421|40044|-1], branchid[ 52 49 52 49 52 49 ],master=-1,me=-1,time=2014-06-23 23:56:53.637+0000/1403567813637,lastcommittedtxwhentransactionstarted=752027] 1pc[3, txid=752028, 2014-06-23 23:56:53.647+0000

python - Estimating confidence intervals around Kalman filter -

python - Estimating confidence intervals around Kalman filter - i have been working implement kalman filter search anomalies in 2 dimensional info set. similar first-class post found here. next step, i'd predict confidence intervals (for illustration 95% confidence floor , ceiling values) predict next values fall in. in add-on line below, i'd able generate 2 additional lines represent 95% confidence next value above floor or below ceiling. i assume i'll want utilize uncertainty covariance matrix (p) returned each prediction generated kalman filter i'm not sure if it's right. guidance or reference how much appreciated! kalman 2d filter in python the code in post above generates set of measurements on time , uses kalman filter smooth results. import numpy np import matplotlib.pyplot plt def kalman_xy(x, p, measurement, r, motion = np.matrix('0. 0. 0. 0.').t, q = np.matrix(np.eye(4))): """ para

python - Mapping arrays with same values but different orders -

python - Mapping arrays with same values but different orders - i have 2 arrays of coordinates 2 separate files cfd calculation. 1 mesh file contains connectivity info , other results file. my problem coordinates each file not in same order. able order arrays results file in same order mesh file. my thought find matching values of xyz coordinates , create mapping such rest of result arrays can ordered. i thinking like: mapping = np.empty(len(co_mesh)) i,coord in enumerate(co_mesh): j in range(len(co_res)): if (coord[0]==co_res[j,0]) , (coord[1]==co_res[j,1]) , (coord[2]==co_res[j,2]): mapping[i] = j where co_mesh, co_res arrays containing x,y,z coords. the problem suspect loop take long time. @ moment i'm looping on around 70000 points in future increment 1 1000000 or more. is there faster way write in python. i'm using python 2.6.5. ben for interested using: mesh_coords = zip(xm_list,ym_list,zm_list,range(len(x_po)))

javascript - JQuery Button enable and disable CSS functionality upon Clicks -

javascript - JQuery Button enable and disable CSS functionality upon Clicks - i'm trying figure out way create leaderboardbutton upon clicking alter div have bottom border radius. (it that). how can upon clicking again, have reset having no border radius. essentially. click once, border radius. click again, no border radius. click again, border radius come back. click 1 time again , border radius leave. etc. etc. , on/off of css radius functions. here's code below. $('#left-container').click(function(){ $('#leaderboard').slidetoggle( "slow", function(){ $('#leadeboardbutton').css({bordertopleftradius: 10, bordertoprightradius: 0, borderbottomleftradius: 10, borderbottomrightradius: 10, webkitbordertopleftradius: 10, webkitbordertoprightradius: 0, webkitborderbottomleftradius: 10, webkitborderbottomrightradius: 10,

oracle - is a a dblink allowed in a J2EE distributed transaction? -

oracle - is a a dblink allowed in a J2EE distributed transaction? - i writing pl/sql procedure (oracle) called j2ee program. j2ee programme has started distributed transaction , pl/sql procedure part of transaction. wonder if allowed utilize dblink within procedure. guess may cause problems because utilize of dblink implies distributed transaction managed oracle, there distributed transaction managed j2ee container. forbidden ? or allowed restriction ? thank answers. if talking xa distributed transactions such configuration supported, limits (it depends on version of oracle db). more details can check this document pay attending section "xa , database links" oracle java-ee plsql dblink xa

python - Pandas: Converting timeseries of values to tracking changes in value -

python - Pandas: Converting timeseries of values to tracking changes in value - i've been stumped on , - uncharacteristically - net has been little help. working in pandas sense must general problem people aiming store timeseries info efficiently. i have lots of standard daily time series info values happen alter infrequently, this: date value 01/02/2014 .1 01/03/2014 .1 01/04/2014 .5 01/05/2014 .5 01/06/2014 .5 01/07/2014 .1 i convert info track days value changes, above illustration should this: date value 01/02/2014 .1 01/04/2014 .5 01/07/2014 .1 unfortunately using drop_duplicates() delete required values in case value reverts prior value (like .1 in illustration above). use combination of shift , all : in [98]: import io temp = """date,value 01/02/2014,.1 01/03/2014,.1 01/04/2014,.5 01/05/2014,.5 01/06/2014,.5 01/07/2014,.1""" df = pd.read_csv(io.stringio(temp)) df out[98]:

asp.net - How to override theme definition -

asp.net - How to override theme definition - take next theme example: <asp:gridview runat="server" allowpaging="true" allowsorting="true"></asp:gridview> if set these values false in grid, .net still utilize defined on theme. how can override these settings? asp.net

java - spinner android with big padding -

java - spinner android with big padding - hello i'm developing app android, utilize 4 spinners, see 'pic' below spinners this: ____________________ |_option__________v_| spinner 1 ____________________ |_option__________v_| spinner 2 ____________________ |_option__________v_| spinner 3 ____________________ |_option__________v_| spinner 4 (i can't post images) the question how can disable 2 3 4 spinners , set values default if 1 has value changed ( default value ), or how same if 2 spinner has value changed? assuming default values @ position 0(first item). then seek next code spinner1.setonitemselectedlistener(new onitemselectedlistener() { @override public void onitemselected(adapterview<?> arg0, view arg1, int arg2, long arg3) { if (arg2 == 0) { spinner2.setselection(0); spinner3.setselection(0); spinner4.setselection(0); sp

java - BitmapFactory.decodeResourse() returns null for shape defined in xml drawable -

java - BitmapFactory.decodeResourse() returns null for shape defined in xml drawable - i looked through multiple similar questions, although haven't found proper reply on query. have drawable, defined in shape.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="@color/bg_color" /> </shape> i want convert bitmap object in order perform operations, bitmapfactory.decoderesource returns null. bitmap bmp = bitmapfactory.decoderesource(getresources(), r.drawable.shape); what doing wrong? bitmapfactory.decoderesourse() applicable xml defined drawables? since want load drawable , not bitmap , utilize this: drawable d = getresources().getdrawable(...); to turn bitmap : public static bitmap drawabletobitmap (drawable drawable) { if (drawable instanceof bitmapdrawable) {

arrays - jQuery "TypeError: invalid 'in' operand a" -

arrays - jQuery "TypeError: invalid 'in' operand a" - i have next json array returning ajax call: {"err":"err_type","fields":["field1","field2"]} when tryin print out function: $.each(data.fields, function (i, field) { console.log(field); $.each(field, function (j, f) { $('[name="'+f+'"]').addclass('form_err'); console.log(f); }); }); i this: data1 typeerror: invalid 'in' operand ...turn function(b){return db(a,b).length>0}}),contains:fb(function(a){return funct... and can't figure out how utilize array! have idea? you iterating string, don't need 2 .each() functions $.each(data.fields, function (i, field) { $('[name="'+field+'"]').addclass('form_err'); console.log(field); }); jquery arrays json each

arrays - How to terminate a nested for loop by clicking a button? -

arrays - How to terminate a nested for loop by clicking a button? - this nested loop in visual basic loops through numbers in array. for x integer = 0 test.length - 1 console.writeline(test(x)) y integer = 0 test.length - 1 console.writeline(test(x) & test(y)) next next i want terminate loop clicking button. since processing powerfulness goes loop, button greyed out. should do? you have utilize system.threading.tasks.task or system.componentmodel.backgroundworker , check see whether task/worker has been cancelled on every loop iteration. multithreading broad topic, this page or this page should started. arrays vb.net loops button

javascript - access elements in array of strings that contain certain strings -

javascript - access elements in array of strings that contain certain strings - i have array can this: ["whatwp", "isvbz", "thedt", "temperaturenn", "inin", "bostonnn"] i want access element containing in, if exists , next elements(s) until reach , including element nn in it. , bring together elements string. when seek access element containing in so, -1 there no element containing in. here's how trying it: strarr = ["whatwp", "isvbz", "thedt", "temperaturenn", "inin", "bostonnn"]; strarr[strarr.indexof('in')]; but undefined because nil @ -1 exists. how can access element of array of strings if contains in , every element after until matches element containing nn, including element? , joining string? you need loop that: var strarr = ["whatwp", "isvbz", "thedt", "temperaturenn", "i

delphi - How to customize the filters in the Quickreport saveas dialog? -

delphi - How to customize the filters in the Quickreport saveas dialog? - in quickreport, when click save button, appears many alternative of extension (quickreport file(.qrp), excel spreadsheet (.xls), , on). i need display quickreport file filter extension option? possible? read quickreport help found nothing. quickreport version 4.06 find , delete (or comment out) qrextra , qrhtml units in uses clause, , remove corresponding componnents (tqrxlsfilter, tqrexcelfilter, tqrhtmldocumentfilter, tqrasciiexportfilter, tqrcommaseparatedfilter, tqrrtfexportfilter, , tqrwmfexportfilter) forms in application. you'll find total list of of available standard export filters in qrexport.pas. (it's of import include version of 3rd party components you're using, particularly alter drastically between versions such quickreports or indy, in order create easier reply question.) delphi quickreports

php - twilio javascript api through get call sid is that possible? -

php - twilio javascript api through get call sid is that possible? - i have trying found phone call javascript client: function call() { // phone number or client connect phone call params = {"phonenumber": $("#number").val()}; twilio.device.connect(params); } in incoming phone call api got phone call sid twilio.device.incoming(function (conn) { alert(conn.parameters.callsid); }); and outgoing phone call api not phone call sid: twilio.device.connect(function (conn) { alert(conn.parameters.callsid); // not working undefine $("#log").text("successfully established call"); }); how phone call sid when twilio device connect call(outgoing call) thanks i have asked twilio exact same question, , reply got don't on client. on server side outgoing phone call in query params voice request url. javascript php jquery twilio twiml

javascript - Passing data from deferred to when -

javascript - Passing data from deferred to when - is there way pass info deferred fail when fail. below, when files have been shown, if of files fail in self.fileshow log names. possible of names 1 time deferrers finished in when? $.when.apply($, $.map(files, function (file, index) { homecoming self.fileshow(file, filesrc, filenewtemplate) .fail(function () { console.log(file.name) }); })).fail(function () { console.log('i want file names here failed') }) this not reply question title, offers solution problem. pass parameters you utilize deferred.pipe . var defer = $.deferred(), filtered = defer.pipe( null, function( value ) { homecoming value * 3; }); defer.reject( 6 ); filtered.fail(function( value ) { alert( "value ( 3*6 = ) 18: " + value ); }); here's illustration of passing object fail. javascript jquery

php - How do I control the order of this multidimensional array, based on a particular value? -

php - How do I control the order of this multidimensional array, based on a particular value? - after reading several posts here subject, unable find exact reply problem. my current array is: array ( [0] => array ( [level] => bronze [name] => jp morgan [logo] => logo ) [1] => array ( [level] => bronze [name] => nasdaq omx [logo] => logo ) [2] => array ( [level] => platinum [name] => credit suisse [logo] => logo ) [3] => array ( [level] => silver [name] => bnp paribas [logo] => logo ) ) what want have sponsors sorted [level] of order is: platinum gold silver bronze how do this? you define own sorting function. example, you'd specify own custom order want follow: $sort_order = array(

c# - WPF Fonts Registering to Windows -

c# - WPF Fonts Registering to Windows - to register custom fonts windows, creating 1 .reg file , adding wpf installer. works fien , fonts gets installed. when uninstall application, fonts gets uninstalled , random fonts gets applied system. actually, whole windows behave differently( guessing wrong happens registry file). how resolve issue? c# wpf fonts

node.js - Getting started with nightwatch.js -

node.js - Getting started with nightwatch.js - can provide me detailed explanation on how setup nightwatch , start writing browser tests? have searched such info online , unable find it. nightwatch.js website had info various nightwatch command line commands, not setting nightwatch project, having problem with. specifically, not have understanding of various files come installation of nightwatch, , how supposed utilize them. you need basiclly two things: the nightwatch.json file in root of project and nightwatch installed ( npm install -g nightwatch ). after utilize on command line as described in documentation here , automatically grab nightwatch.json file , run tests based on default test_setting . i opened an issue add together nightwatch init command, setup of nightwatch.json file easier. further reading how setup nightwatch.json github repository node.js nightwatch.js

android - my application crash in ListView Event orThread -

android - my application crash in ListView Event orThread - lst.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, final view view,int position, long id) { //btnsub button btnsub.setenabled(true); toast.maketext(getapplicationcontext(), "before start()", toast.length_short).show(); for(int i=0;i<j;i++){ //lst listview object view vtmp = lst.getchildat(i); if(vtmp !=null){ if(i==lst.getcheckeditemposition()){ //cindex int var cindex=lst.getcheckeditemposition(); }else{ } } } new thread() { public void run() { toast.maketext(getapplicationcontext(), "in thread ", toast.length_long).show(); try{ thread.sleep(1000); lst.getchildat(cindex).setbackgroundcolor(color.blue); }catch(exception e){

php - Fallback with scrolling loaders -

php - Fallback with scrolling loaders - fantastic community have here, onto first question. i'm creating blog scratch, , know can load content on scrolling events using jquery , php (to save loading @ once). of don't know how or is, can find tutorial link here: http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html however, method relies on javascript requests. in name of practice , 1-2% of people still load yahoo homepage java-script disabled. result in user loading few posts, or loading entire set of posts. i'd find best progressive workaround allow me to: if javascript enabled (load content using above jq/php scrolling method normal) if javascript disabled (grayskull forbid!?) fall more html/css reliant method automatically, without me having design separately. quite complex question, hope makes sense. if i'm thinking along right lines, html/css fallback might break content separate pages , page buttons, i'm unsure how 2 mi

java - Hibernate @OneToMany EAGER doesn't work -

java - Hibernate @OneToMany EAGER doesn't work - i have 2 entities, topics , posts respectively. here's many posts 1 topics . so had set topics onetomany : class topics implements serializable { ... @onetomany(fetch = fetchtype.eager, mappedby = "topic") @orderby("date desc") private list<posts> postslist; public list<posts> getpostslist() { homecoming this.postslist; } } in posts entity not specific settings topic field, typical integer . so problem can't fetch postslist eager fetch type, remain lazy anyway: topics thetopic = (topics) session.load(topics.class, topic); list<posts> postsoftopic = thetopic.getpostslist(); ... list contains 1 object now, it's total of nulls. any ideas how fix? the session.load method typically returns proxy whereas session.get method guaranteed homecoming initialized entity , eagerly fetch collection if marked such. there alterna

java - AutoHotkey - Command Prompt Issues -

java - AutoHotkey - Command Prompt Issues - so have been using autohotkey , fan of running couple of issues. compile , run java programs command terminal in windows 7. paths compiler ( javac ) , run programme ( java ) set , run when open command prompt without using autohotkey. but, run ahk script opens command terminal same location , seek , utilize java command next message error: not open 'c:\program files(x86)\java\jre7\lib\i386\jvm.config' i understand not able find location considering running java 1.8.5_05 not know why path not working properly. stranger part when open command prompt autohotkey javac still recognized , running right version. my question this. why able compile , run java programs when opening terminal when click cmd.exe icon unable run java programs when terminal opened via simple autohotkey script? any suggestions appreciated. note: systems path variable , user path variable correctly set java_home points 1.8.5_05 version

opencv - how to understand the C++ syntax of this code line? -

opencv - how to understand the C++ syntax of this code line? - what's meaning of &i.operator iplimage() , seems unfamiliar in c++ syntax. mat i; ptr<iplimage> pii = &i.operator iplimage(); i not user of opencv can give overview of code doing: mat i; creates mat object given name of i . let's cutting next line up: ptr<iplimage> pii seems smart pointer iplimage . &i.operator iplimage() converts mat object of iplimage taking address. c++ opencv

javascript - jQuery selector custom attribute -

javascript - jQuery selector custom attribute - i have elements in page like <div class="editabletxt" data-model-attr="name" data-model-id="123">some text</div> now how write selector in jquery based on 2 custom attribute values. want select element data-model-attr="name" data-model-id="123" i want unique element. utilize 2 attributes. use this $("[data-model-attr='name'][data-model-id='123']") javascript jquery

ios - setting up iBeacon on two devices Xcode -

ios - setting up iBeacon on two devices Xcode - i experimenting game app uses ibeacon notify user person wants connect them play 1 of 8 games. have created peripheral manager , various regions (one each game using unique uuid , region.identifier. since using same view controller both transmit ibeacon info , receive have user tap button either set device broadcast specific game beacon info or tap button receive specific game beacon info. here code; //this sets transmitter -(void) configuretransmitter { // received signal strength indicator (rssi) value (measured in decibels) device. value represents measured strength of beacon 1 meter away , used during ranging. specify nil utilize default value device. nsnumber * powerfulness = [nsnumber numberwithint:-63]; self.peripheraldata = [self.beaconregion peripheraldatawithmeasuredpower:power]; // global dispatch queue. dispatch_queue_t queue = dispatch_get_global_queue(dispatch_queue_priority_default, 0);

mysql - select a mix of multiple entries -

mysql - select a mix of multiple entries - i have table 2 columns: name | type now querying table autocomplete html form , result similar pseudo query. select 10 closest_names each type names input any thought how real query like? i have experience in autocomplete value comes database asking query right? here's example, hope help select name,type <table> name '%input%' limit 10 mysql autocomplete

mysql - Update table with random values from given set of string values -

mysql - Update table with random values from given set of string values - i want update table random values given set, not table. e.g. value1, value2, value3 and mysql query should update records above values. i looking similar type of solution random string values given set: update column random value use floor(rand()*3) generate random number among 0, 1, , 2, utilize case when assign value update test set = (case floor(rand()*3) when 0 0 when 1 10 when 2 20 end); fiddle mysql random

javascript - Issue with .on() method -

javascript - Issue with .on() method - i trying create mvc training purposes , next tutorial rather old. implementation in tutorial made using live() decided utilize jquery 2.1.1 , have implement on() method. made little utilize case clarification. i can insert new elements on page while adding them in db i can delete preloaded elements existed in db @ page load both db , dom i can not remove elements added live neither db nor dom. this entire code regarding that. $(function(){ $.get('dashboard/xhrgetlistings', function(o){ (var = 0; < o.length; i++ ) { $('#listinserts').append('<div>' + o[i].text + '<a class="del" rel="' + o[i].id + '" href="#">x</a></div>'); } $('.del').on("click", function() { delitem = $(this); var id = $(this).attr('rel'); $.post('dashboard/xhrdeletelisting', {'i

javascript - Centering with ImageMapster -

javascript - Centering with ImageMapster - i have image uses imagemapster wrapped in div, div won't center reason. if remove js code, div centers, it's due image mapster stuff. it's quite simple, just: <div class="chartmap"> <img id="waterfall" align="middle" src="http://i1372.photobucket.com/albums/ag358/rls462/waterfall_zpsdd7cc432.png" usemap="#water" alt="waterfall methodology map"> <map name="water"> <area ......> ... </map> </div> here's demo: http://jsfiddle.net/stamblerre/t6k8x/13/ any thoughts? thanks!!!! when initializing mapster on img element, jquery wraps image dynamic container thats aligned left default. want re-align dynamic container center: $('#waterfall') image, access wrapping container need phone call $('#waterfall').parent() , align it: .css({"margin":"0 aut

html - Cant add menu links to container -

html - Cant add menu links to container - i have logo , image slider in container side side @ times im trying add together 3 menu links horizontally under logo cant seem it, maintain going above image slider jams downwards. suggestions on do? heres jsfiddle : jsfiddle.net/gzdvl/17/ conceptually, seems want 2 columns. why not create html represent that? <div> <!-- logo , links here --> </div> <div> <!-- slider here --> </div> float divs, , you're good. html css image hyperlink slider

php - Composer, PSR-4 Autoloading Itteration -

php - Composer, PSR-4 Autoloading Itteration - i running slim , twig, folder construction follow /application/modules in composer.json have "autoload": { "psr-4": { "application\\": "application/modules/", "core\\": "application/", "middleware\\": "application/slim/middleware/" } } my issue is in application\modules\ have directory each module. question is, possible create composer iterate through sub directories when using psr-4 autoload? i see issue psr-4 declaration. you shouldn't place "core" classes within folder has subfolders other namespaces. psr-4 autoloading in composer works this: if qualified class name of class load matches prefix declared in of psr-4 definitions, prefix mentioned in prefix removed class name, , remaining class name mapped filename , beingness searched. if have classes

java - Accessing jar file libraries at runtime -

java - Accessing jar file libraries at runtime - in code, near top of 1 of source files line: import com.google.code.chatterboxapi.chatterbox; this external jar library, , when ran code, build jar file, in command line outside ide using, java complained couldn't find com.google.code.chatterboxapi.chatterbox. how tell jvm find jar libraries are? you utilize classpath alternative of java -cp <class search path of directories , zip/jar files> -classpath <class search path of directories , zip/jar files> : separated list of directories, jar archives, , zip archives search class files. java jar loading

haskell - Is there a reason we can't populate types with DataKinds? -

haskell - Is there a reason we can't populate types with DataKinds? - with datakinds, definition like data kfoo = tfoo introduces kind kfoo :: box , type tfoo :: kfoo . why can't go on define data tfoo = cfoo such cfoo :: tfoo , tfoo :: kfoo , kfoo :: box ? do constructors need belong type belongs kind * ? if so, why? edit: don't error when this, because constructors , types share namespace, ghc permits conflicts because disambiguates names regular types, rather promoted constructors. docs prefix ' refer promoted constructor. when alter sec line to data 'tfoo = cfoo i error malformed head of type or class declaration: tfoo do constructors need belong type belongs kind * ? yes. that's * means: it's kind of (lifted / boxed, i'm never sure part) haskell types. indeed other kinds aren't kinds of types though share type syntax. rather * metatype-level type types, , other kinds metatype-level types thin

if statement - C++ if-else if Issues -

if statement - C++ if-else if Issues - i'm having issues programme below. should convert numbers between 1-100 aa,ba,bb,cb,cc,d,f. stops working , shows "ba" if come in number less 84. checked code. don't understand problem. #include <iostream> using namespace std; int main() { int secenek,notu; cout << "not dönüştürücü" << endl; cout<<"başlamak için 1'e basın:\n"; cin>>secenek; if (secenek==1) { cout<<"dönüştürülecek not: "; cin>>notu; } if (notu<0 || notu>100) { cout<<"geçerli bir not girin.\n"; } else if (notu>=90) { cout<<"aa"; } else if (notu<90 || notu>84) { cout<<"ba"; } else if (notu<85 || notu>79) {

javascript - kaminari paginate via ajax ,remote = true is not affect on view in rails 3 -

javascript - kaminari paginate via ajax ,remote = true is not affect on view in rails 3 - hello using kaminari gem pagination , want paginatation via ajax . index.html.haml #abc = render :partial => 'anything/anything_lists', collection: @anything_upcoming, as: :anything_schedule #paginator = paginate @anything_upcoming, :remote => true, :param_name => "anything_upcoming_page" index.js.haml $('#abc').html('#{escape_javascript render(partial: "anything/anything_lists")}'); $('#paginator').html('#{escape_javascript(paginate(@anything_upcoming, :remote => true, :param_name => "anything_upcoming_page").to_s)}'); controller file: @anything_upcoming = anythingschedule.anything_upcoming.page(params[:anything_upcoming_page]).per(settings.pagination.per_page) respond_to |format| format.js format.html end view source shows data-remote = true log shows website::eventscontroller#ind

javascript - How to get a page printed with its css intact in ruby on rails? -

javascript - How to get a page printed with its css intact in ruby on rails? - i using ruby-on-rails-3.2 app, trying print-out of page when gets printed doesnt have css. here code <%= link_to("print page", "#", :onclick =>"printelem('.printelem','news details')") %> function printelem(news_heading, reporters_details, full_news_text, title) { heading = jquery('head').html(); body_data = jquery('body').html(); popup(heading, body_data); homecoming true; } function popup(news_heading, body_data) {//start // var mywindow = window.open('','printwindow'); mywindow = window.open('#','printing','height=900,width=900,scrollbars=1'); mywindow.document.write('<html><head>'+heading+'</head><body onload="window.print();">'); mywindow.document.write(body_data); mywindow.d

javascript - Knockout: filling observable with an email produces [object HTMLinput] output -

javascript - Knockout: filling observable with an email produces [object HTMLinput] output - i have string "admin@admin.ru" take out of cookies. i have model var loginmodel = function () { this.authemail = ko.observable(""); this.authpassword = ko.observable(""); }; var ajaxloginmodel = new loginmodel(); i do ajaxloginmodel.authemail("admin@admin.ru"); it works fine, in input element in looks html: <form class="form-horizontal" id="form-ajaxlogin"> <fieldset> <h4 align="center">Пожалуйста, авторизуйтесь.</h4> <div class="control-group" align="center"> <label class="control-label control-label-120" for="authemail">e-mail</label> <div class="controls"> <input type="text" name="

Saving a plot from R and then copying it to a Word text file -

Saving a plot from R and then copying it to a Word text file - this question has reply here: how save plot image on disk? 9 answers what have tried far: par( mfrow = c( 1, 2 ) ) matplot(rou,type="l", ylim=range(rou)) matplot(rem,type="l", ylim=range(rem)) here sample code taken the r statistics website basically have create new word file create headers , sub-headers move new pages in document write text insert tables (that “data.frame” , “matrix”objects) insert plots save , close word document code: # install.packages("r2wd") # library(help=r2wd) require(r2wd) wdget(t) # if no word file open, start new 1 - can set if have file visiable or not wdnewdoc("c:\\this.doc") # creates new file "this.doc" name wdapplytemplate("c:\\this.dot") # applies template wdtitle("examples

java - Read and write from a socket simultaneously -

java - Read and write from a socket simultaneously - i'm writing android app in java , want create listener receive messages in while(true) loop, , able send messages server. task i'm using sockets asynctask . have written connectionhandler class handle send , receive requests app. so far good, working fluently sending , receiving messages 1 @ time, couldn't find way simultaneously. i need execute next code in thread, don't know how it, because have homecoming string : public static string receive() { seek { homecoming mconnectionhandler.new asyncreceivefromserver().execute() .get(); } grab (interruptedexception e) { e.printstacktrace(); } grab (executionexception e) { e.printstacktrace(); } homecoming null; } private class asyncreceivefromserver extends asynctask<void, void, string> { @override protected string doinbackground(void... params) { string result = null;

java - I installed fitnesse-editor for Eclipse but it is not working at all -

java - I installed fitnesse-editor for Eclipse but it is not working at all - windows->preferences no fitnesse configurations right click not fitnesse alternative well there can many reasons such error. try starting eclipse -clean parameter. in logs, @ workspace/.metadata/.log. see http://wiki.eclipse.org/faq_where_can_i_find_that_elusive_.log_file%3f if else fails, seek re-installing eclipse new folder. rename old eclipse folder maintain backup. java eclipse-plugin fitnesse acceptance-testing

java - Why is my EJB3,1 timer running on both server instances? -

java - Why is my EJB3,1 timer running on both server instances? - we have @singleton ejb running timer timeout method created next annotation: @schedule(hour = "*", min = "*/5", sec = "0") public void processcodes() { for long time run on single instance of clustered server, insists on running on both instances, causing duplicate work. we added 'persistent', so: @schedule(hour = "*", min = "*/5", sec = "0", persistent = true) public void processcodes() { even though that's supposed default. still runs on both servers. there server setting should check create sure cluster created? any suggestions on seek or next appreciated. thanks! peter by default, ejb container uses server-specific database hold persistent timers. in clustered (network deployed) environment, need configure ejb container utilize info source points mutual database. easiest way configure ejb timer service

ember.js - Best way to switch controller and view of a route based on a property of model -

ember.js - Best way to switch controller and view of a route based on a property of model - i need alter view , controller of route based on property of model. illustration lets assume have route hierarchy defined as: ember.router.map(function () { this.resource("games", function () { this.resource('game', {path: ':game_id'}, function () { this.route('basics'); this.route('advanced'); }); }); }); and game model looks this: app.game = ds.model.extend({ name: ds.attr('string'), category: ds.attr('string) }); so if name of game football, , wanted go basics route of game want utilize footballbasicscontroller , utilize football-basics-view. way doing using rendertemplate hook in gamebasicsroute this: as.gamebasicsroute = em.route.extend({ ...... rendertemplate: function (controller, model) { var gamename = model.get("name&quo

java - create 2d list of sets -

java - create 2d list of sets - this question has reply here: cannot instantiate type set 3 answers i trying 2d grid/array each cell set. purpose utilize next code example list<set<integer>> grid = new arraylist<set<integer>>(); // in line set underlined error grid.add(new set<integer>()); grid.get(0).add(2); but says - "cannot instantiate type set". want instantiate new list dimension , each of dimension cells should sets? , comes question how iterate efficiently through grid? set interface, neeed instanciate specific implementation of set, illustration hashset . java arrays collections interface set

Buildmaster throws System.IO.PathTooLongException when deploying an artifact? -

Buildmaster throws System.IO.PathTooLongException when deploying an artifact? - when seek , deploy artifact team city build on build master system.io.pathtoolongexception none of files have more 260 characters. what do now? support paths greater 260 characters added in v4.5 of software should no longer issue. buildmaster

javascript - Removing "Series" label on highcahrt-columnrange chart -

javascript - Removing "Series" label on highcahrt-columnrange chart - as see in attachment. want take off "series 4" tooltip my xaxis displays date , yaxis displays difference between end_time , start_time but don't know "series 4" comes from. additional code : var series = []; $.each(tasks.reverse(), function (i, task) { var item = { name: task.name, data: [] }; $.each(task.intervals, function (j, interval) { item.data.push({ x: interval.from, y: i, label: interval.label, from: interval.from, to: interval.to }); }); series.push(item); any help appreciate? thank

jquery - Internet Explorer: Bad visualization of CSS Table (table-row, table-cell) -

jquery - Internet Explorer: Bad visualization of CSS Table (table-row, table-cell) - i´ve made css table construction using display table, table-row , table cell properties. each p has table-row property , jump line ok. when set 2 o more elements (input or select) in same <p> elements inline in ie (last version) jump of line in spite of belong same <p> is there solution prepare this? perfect visualization firefox, elements in line. thank you. <p><label>name (first, second): </label><input type="text" /><input type="text" /></p> example: http://jsfiddle.net/hy62t/ add next class in css. fieldset input{display:inline-block} it resolve issue , display in browsers. demo jquery html css internet-explorer table

itextsharp - How to scale a page less then 1 percent? -

itextsharp - How to scale a page less then 1 percent? - i want scale total pdf-page , insert new document. works fine. have problems scale-factor when factor less 1%. illustration factor of 0,5%, no scale happening. factor 0,7%, document (rectagle) has right size, scaled page bigger calculated new size. there way scale page continuously? looks like, in such cases little scale factors, scaling works in stages. or maybe there problem internal matrix-calculation? float scale = 1.005f; //100,5% var newwidth = originwidth*scale; var newheight = originheight*scale; pdfreader reader = new pdfreader(inputfile); var newmediabox = new rectangle(newwidth, newheight); document doc = new document(newmediabox); pdfwriter author = pdfwriter.getinstance(doc, new filestream(outputfile,filemode.create)); doc.open(); pdfcontentbyte cb = writer.directcontent; pdfimportedpage page = writer.getimportedpage(reader, 1); //page #1 cb.addtemplate(page, scale, 0, 0, scale, 0, 0); doc.close();

python - How to combine/join regular string with regex result? -

python - How to combine/join regular string with regex result? - so have simple code: def modify_mysql_log(): #/var/log/mysql/mysql.log #change: queries f=open("../mysql/mysql.log") t=open("../mysql/mysql2.log","w") line in f: line=re.sub(r'query\s*select[a-za-z\s+\w_]*\'',random.choice(queries),line) t.write(line) f.close() t.close() now trying want able replace line query found regular look regular expresion used search with, random.choice(queries) combined regular exression result. i've looked @ other re functions somehow cant see how that. line=re.sub(r'regex', random.choice(queries), line) this code homecoming string obtained replacing "leftmost non-overlapping occurrence" of regex random.choice(queries). if regex not found returning line. if understand problem correctly, seek searching line regex , using string.replace(string_found_by_regex, rand

regex - How do I target this character ’ and replace it using jQuery? -

regex - How do I target this character ’ and replace it using jQuery? - i want replace singe (apostrophe) , double quotes nil using jquery. have form text area , characters not allowed. able replace these characters ' " not character ’ below code works first 2 characters not third: function removequotes(str){ var str = $(str).val(); if(str != ''){ str = str.replace(/(['"’])/g, ''); homecoming str; } }; $('textarea').on('blur', function(){ $(this).val(removequotes($(this))); }); i input string it's it"s it’s and blur off text-area, output its it’s i have not been able rid of 3rd quote. noticed when copying line of text outlook (the 3rd it's). str = str.replace(/([`'"’])/g, ''); jsfiddle http://jsfiddle.net/guest271314/xkes3/ jquery regex

ms access - unixODBC PHP Update statement error -

ms access - unixODBC PHP Update statement error - i'm using ubuntu+php+unixodbc+mdbtools working .mdb file. every thing(connection+select) works good, insert or update statements. code : $mdbconnection = new \pdo("odbc:mdbdriver",$user , $password , array('dbname' =>$filename) ); $selectresult = $mdbconnection->query("select * zone"); $updateresult = $mdbconnection->query("update zone set shahrcode = 99"); $selectresult returns right result, sec 1 throws error cause apache segfault error. test isql command.running select statement successful update not. #isql mdbdriver +---------------------------------------+ | connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ sql>update zo

c++ - how to get rid of lambda syntax -

c++ - how to get rid of lambda syntax - i need create function in "normal" syntax. how alter it? template <template <class, class> class container> typename const container<course*, std::allocator<course*> > schedule<container>::getallcourses( ) const { container<course*, std::allocator<course*> > newone; std::for_each(courses.begin(), courses.end(), [&newone](course *c) {course* nc = new course(c->getname(),c->getnumber(), c->getfaculty()); newone.push_back(nc);}); //make container , force every course of study homecoming newone; } actually, need alter function "for_each" utilize outside class. don't know how it. can help? a lambda function closure type, implemented unnamed functor. you keywords, understand how perform "conversion". pretty much rule lambda : [capture_clause](args) -&g

r - Order an XTS object -

r - Order an XTS object - i have xts structure: variable1 variable2 variable3 2014-06-23 2 1 3 the values these variables ranks. i've ranked them parameter , want show these ranks in tabular way , show past ranks these variables well. in end output should this: 2014-06-23 rank3weeksago rank6weeksago variable2 1 1 2 variable1 2 3 1 variable3 3 2 3 so need original xts sorted ascending , add together necessary columns myself. i'm not able correctly sort xts. how can this? my current code transposed view: originalxts transposed<-t(originalxts) transposed anyway matrix , variable names index row, cannot access them. i'm struggling here anyway. r xts