Posts

Showing posts from April, 2014

ios - variable value causing error: IR generation failure program too clever -

here simple code causing problem: class coreviewcontroller: uiviewcontroller { private let ispad = ui_user_interface_idiom() == .pad } following erorr message <unknown>:0: error: ir generation failure: program clever: variable collides existing symbol objc_class_$_uidevice no error, if remove ui_user_interface_idiom() == .pad any thoughts? ui_user_interface_idiom not work in swift, it's objective-c macro. solution option 1. use uidevice.currentdevice().userinterfaceidiom instead. switch uidevice.currentdevice().userinterfaceidiom { case .phone: // it's iphone case .pad: // it's ipad case .unspecified: // undefined } option 2. request uitraitcollection instance , check idiom (recommended) let deviceidiom = uiscreen.mainscreen().traitcollection.userinterfaceidiom switch (deviceidiom) { case .pad: // it's ipad case .phone: // it's iphone case .tv: //...

ios - pod lib lint fails implicit declaration of function 'DLog' is invalid in C99 -

i tried declare macro on prefix.pch file works great on xcode , passes validation on travis. my macro looks like: #ifndef release #define dlog(__format__, ...) nslog((@"%s [line %d] " __format__), __pretty_function__, __line__, ##__va_args__) #else #define dlog(...) #endif my podspec file this: pod::spec.new |s| s.name = "myexampleproject" s.version = "1.0.1" s.summary = "xxx" s.homepage = "xxxxxx" s.license = {:type => 'mit', :file => 'license.md' } s.author = { "xx" => "xx@xx.com" } s.platform = :ios, "8.0" s.source = { :git => " https://github.com/xx/xx.git ", :branch => "master", :tag => s.version } s.source_files = "myexampleproject/ / .{h,m}" s.public_header_files = "myexampleproject/ / .{h}" s.requires_arc ...

python - Issues with pyinstaller and reportlab -

alright have python project want compile, decided use pyinstaller (first time compiling python). compiled fine when run exe returns -1. after bit of messing around figured out related reportlab.platypus. so first instinct check see if using hooks changed anything, tried adding reportlab.pdfbase._fontdata , reportlab.lib.utils hooks (these hook files find related reportlab). despite effort still failed. here output when exe run terminal: traceback (most recent call last): file "<string>", line 12, in <module> file "<frozen importlib._bootstrap>", line 969, in _find_and_load file "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked file "<frozen importlib._bootstrap>", line 664, in _load_unlocked file "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible file "c:\users\jon\desktop\pyinstaller-3.1.1\pyinstaller\loader\pyimod03_importers.py...

php - Prevent Unknown robot from crawling my website and save bandwidth -

i have drupal operated small website. not commercial, ie: no income it. site in shared host, has limited bandwidth , resource. site encounters "bandwidth exceed" problem every month because more 60% of bandwidth being used bots , spiders. maximum gone to: unknown robot (identified 'bot' followed space or 1 of following characters _+:,.;/-) out of 10gb bandwidth, 1 gb goes googlebot (it's ok) 6 gb goes unknown robot (identified 'bot' followed space or 1 of following characters _+:,.;/-). 500mb goes unknown bots identified robot other 500 mb goes bots identified spider, crawl, empty user-agent etc. so remains? less 2gb visitors. how identify or block bad bots? please suggest me way prevent it.

c - Extra characters added to beginning of string? -

i have 2 characters being added beginning of string , can't seem find out why. characters don't appear in code. i'm @ loss here. code: #include <stdlib.h> #include <stdio.h> #include <string.h> char *chars; char* vector(char input, char *newlist); int main(){ char *input, *out = "input: "; printf("enter characters: "); while(1){ char = getchar(); //get input if(i == '\n'){ break; //detect return key } else{ input = vector(i, input); //call vector } } char * print = (char *)malloc(1 + strlen(input) + strlen(out)); strcpy(print, out); //concat strings strcat(print, input); printf("\n%s", print); //print array free(print); free(input); free(chars); return 0; ...

multithreading - iOS using pthread_mutexattr_t trouble -

i porting existing c++ project objective-c++ , came across mutex stuff. not sure done here neither if correct. initialize kind of multithreading lock mechanism (called "criticalsection") following done: #include <pthread.h> pthread_mutex_t cs; pthread_mutexattr_t attr; later in code: pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, pthread_mutex_recursive); pthread_mutex_init(&cs, &attr); to enter "lock" there is: pthread_mutex_lock(&cs); to leave "lock": pthread_mutex_unlock(&cs); pthread_mutex_destroy(&cs); my question (since have no clue how done) is: correct implementation? because encounter problems lock mechanism not work (bad memory access errors, corrupt pointers in situations "criticalsection" used). it's correct except don't want destroy mutex when unlocking. destroy mutex when can guarantee threads have finished it. for example: class criticalsec...

php - How to pass an argument into call_user_func -

here line of code using: $json[jsonconstant::json_custom] => call_user_func(array($this, $customtypes[$customdownloadtype])), $customtypes[$customdownloadtype] might resolve gettags() . what do though, if want pass argument gettags() though? example, have var called $time want pass in? do? it seems want mixture of examples 2 , 4 http://php.net/manual/en/function.call-user-func.php - possible? thanks call_user_func($fn, 'a', 'b', 'c'); // => $fn('a', 'b', 'c'); call_user_func_array($fn, ['a', 'b', 'c']); /// => $fn('a', 'b', 'c');

android-youtube-api makes error when playing youtube contents with ad -

android-youtube-api makes error when playing youtube contents ad. version of youtube apk latest : 11.04.56 androidver: kitkat(4.4.4) status: contents advertisement, click play button in youtubeplayersupportfragment. this error log below... 02-29 13:04:41.573 27114-27114/? e/youtubeandroidplayerapi: media_ad_play_requested videostageevent received adstatsclientmanager without adreporter being constructed. 02-29 13:04:42.168 27114-27114/? e/youtubeandroidplayerapi: trying interaction logging without setting interactionlogger 02-29 13:04:42.183 29397-29397/? e/dalvikvm: not find class 'tc', referenced method sz.<clinit> 02-29 13:04:42.188 29397-29397/? e/dalvikvm: not find class 'tb', referenced method sz.<clinit> 02-29 13:04:42.188 29397-29397/? e/dalvikvm: not find class 'td', referenced method sz.<clinit> 02-29 13:04:42.188 29397-29397/? e/dalvikvm: not find class 'ta', referenced method sz.<clinit> 02-29 13:04:42.198 29...

php - Deny entry using .htaccess -

i have page home.php can access loging in , inside page can download files. trying if put in browser: www.domain.com/home.php/file.pdf , enter, not download file. mean, can download file clicking on link in home.php . i have tried code, when click link, sends me error: forbidden. setenvifnocase referer "^https://www.domanin.com/home.php" local_ref=1 order allow,deny allow env=local_ref thank time. you can use following code : setenvifnocase referer ^https?://www.domanin.com/home.php/.+\.pdf local_ref=1 order allow,deny allow deny env=local_ref this forbid request - https://www.domanin.com/home.php/file.pdf (referer).

Omnet++, How can I get list of all scheduled events of a module? -

i scheduling list of events against node in omnet++ using: scheduleat(simtime().dbl() + slottime, msg) and there multiple such schedule in future event list single module. now @ given time instant want cancel future scheduled events of node , that's why need list of future events. to best of knowledge cancelevent(msg) cancel 1 event. how can find list , remove events. please help. to access list of all future events 1 can use getmessagequeue() . , remove own events (i.e. selfmessages) every event in list has checked using isselfmessage() . sample code, removes selfmessages future event set: cmessageheap& heap = csimulation::getactivesimulation()->getmessagequeue(); cmessageheap::iterator it(heap); { cmessage * event = it(); if (event && event->isselfmessage()) { cancelanddelete(event); it.init(heap); } else { it++; } } while (!it.end());

Get facebook user if only logged in facebook php sdk -

i want current loggedin facebook user in php sdk. here have tried: $facebook = new \facebook(array( 'appid' => 'xxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxxxxxxx', )); $user = $facebook->getuser(); var_dump($user); if ($user) { $logouturl = $facebook->getlogouturl(); echo $logouturl; } else { $loginurl = $facebook->getloginurl(); echo $loginurl; } when load page above code, loginurl though logged in facebook. when load $loginurl in browser, able facebook user. how current user @ first load of page? i loginurl though logged in facebook. of course – being logged in facebook.com different being logged in your app . only when load $loginurl in browser, able facebook user. that’s because after user logged in application. how current user @ first load of page? only possible users have connected app @ point before, using javascript sdk.

How to transliterate Cyrillic to Latin using Python 2.7? - not correct translation output -

i trying transliterate cyrillic latin excel file. working bottom , can not figure out why isn't working. when try translate simple text string, python outputs "eeeee eee" instead of correct translation. how can fix give me right translation?? have been trying figure out day! symbols = (u"абвгдеёзийклмнопрстуфхъыьэАБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЬЭ", u"abvgdeezijklmnoprstufh'y'eabvgdeezijklmnoprstufh'y'e") tr = {ord(a):ord(b) a, b in zip(*symbols)} text = u'Добрый Ден' print text.translate(tr) >>eeeeee eee i appreciate help! your source input wrong. entered source , text literals, python did not read right unicode codepoints. instead, suspect pythonioencoding variable has been set error handler set replace . causes python replace codepoints does not recognize question marks. all cyrillic input treated not-recognized. as result, codepoint in translation map 63, question mark, mapped last c...

Delphi save text file on Android -

i have upload text file on android project , used idftp . code: button2.enabled:=false; label5.text:='uploading...'; memo1.lines.add(edit1.text+':'+combobox1.items.text); memo1.savetofile('filehost.txt'); try idftp1.connect; // set host, password , username idftp1.put('filehost.txt'); idftp1.disconnect; i having problem because when run app on samsung (android 2.3) have error says cannot create file "/filehost.txt". not directory . i must save content of memo1 in android device , upload using idftp. how can avoiding error? you can't write root folder. use tpath find writable folder, such tpath.gettemppath() or tpath.getdocumentspath() . alternatively, not use file @ all. tidftp.put() has overloaded version uploads tstream instead of file, eg: var ms: tmemorystream; begin ms := tmemorystream.create; try memo1.lines.savetostream(ms); ms.position := 0; ... idftp1.put(ms, 'filehost.t...

c# - How to use automapper from string to List of Strings -

using automapper how convert string separated spaces list ? data: foo1 foo2 foo3 foo4 class: public class myfoolist { public int myid; public list<string> mylistofstrings; } using automapper defaults. mapper.createmap<data,myfoolist>() .formember(d=>d.mlistofstrings, s=>s.mapfrom(s=>s.data)); i data in form of 1 line per character. ex: f o o 1 f o o 2 etc..etc.. mapper.createmap<data,myfoolist>() .formember(d=>d.mlistofstrings, s=>s.mapfrom(s=>s.data.split())); looks automapper makes reasonable assumption , enumerates string character character. explicit split. nvoigt's suggestion correct - sure want use automapper?

asp.net - WebException using reportviewer -

i'm trying connect reportingservices through asp.net web reportviewer control: rvcontract.processingmode = microsoft.reporting.webforms.processingmode.remote; rvcontract.serverreport.reportservercredentials = new reportservercredentials("myusername", "mynetworkpassword", "domain"); rvcontract.serverreport.reportserverurl = new uri(reportconfiguration.reportserverurl); string rptpath = reportconfiguration.rootpath; if (!rptpath.endswith("/")) { rptpath += "/"; } rvcontract.serverreport.reportpath = rptpath + "adminreports/contract"; list<reportparameter> reportparams = new list<reportparameter>(); if (mkosession.accountid.hasvalue) { reportparameter accountid = new reportparameter("accountid", mkosession.accountid.value.tostring()...

Maximum number of tables in hbase -

what maximum number of tables can create in hbase?. if create tables saving every hour data. example 24/8/3013 8:00pm data stored in 24_8_2013_8 affect hbase performance. looks have misunderstood hbase. not meant used this. use hbase when need store really huge amounts of data. how data 1 acquire in 1 hour? doesn't sound wise me. better think of schema if have such requirements. perhaps 1 row/hour, or suits use case. table each hour sounds illogical me.

php - Symfony2 : How to force download multiple images in one zip file with Ajax -

this ajax request : function downloadzip() { var searchids = $("#image_id:checked").map(function(){ return $(this).val(); }).get(); $.ajax( { type:'post', url: $('#admin_product_zip').text(), data: {searchids:searchids}, success: function(response) { } } ); return false; } and controller method, i'm getting product ids , fetch these id's database, getting proper images paths : public function zipmultipledownload($data){ foreach($data $product_ind) { $product = $this->repo->find(3); $images=$product->getcolorimagespaths(); $itemimages=$product->getitemimagespaths(); $archive_file_name =$product->getname().$product->getid().'.zip'; //print_r($itemimages); //return new response('test'); ...

html - What causes FireFox to shift a float left 50% width over? -

i have set of divs same width , height. set float left , 50% of container (the container 100% width of page). @ screen widths couple divs shifted on 50% though there element beside it. <div class="container"> <div class="pod"> <img /> </div> <div class="pod"> <img /> </div> </div> if adjust width of window can fix issue. happens @ multiple window widths , (from can see) in firefox. i'll work on jsfiddle see if can replicate show it. until then, has dealt before , found issue? ----- edit ----- i'm able reproduce in chrome changing page width. it's more see in firefox. if change boxes 50% 47% issue goes away... ----- edit ----- turns out "split" i'm doing causing issue. two jsfiddles: how divs respond (i forgot mention of divs "split". didn't think part of issue till now) http://jsfiddle.net/dcp3450/xvmhr/ how divs respond without split: http://jsfi...

eclipse - Java- reading from .data files -

i'm having couple of problems setting system read data java program 2 .data files... i'm using eclipse ide, , have created project in folder 2 .data files want use. i've started project, still @ beginning... the 2 .data files are: car.data , owner.data, , have start project. i've created few classes: owner.java, car.java , readfile.java (to read data .data files). at present, owner.java file looks this: import java.io.*; public class owner { public static void main(string[] args) throws ioexception { // todo auto-generated method stub readfile rf = new readfile("owner.data"); rf.read("owner.data"); } file f; public string id; public string lastname; public string firstname; public string street; public string city; public void readowner() throws filenotfoundexception{ //file f = new file("smart stream associate software engineer (java) - bristol/assessment/src/owner.java"); //inputstream = new fileinput...

javascript - JSON data 400 Bad request Error -

i have json data sending server. when submit printing data in console not sending server. it gives following error post http://localhost:8080/rest/review/createreview 400 (bad request) here code var promise = jquery.ajax({ url: 'http://localhost:8080/rest/review/createreview', type: 'post', data: '{myreview: myreview}', datatype: "text", contenttype: "application/json", success: function (data) { console.log("request successful", data); }, error: function (data) { console.log("request failed", data); } }); it may data not valid json. try: data: json.stringify({myreview: myreview})

rally - LBAPI "removeUnauthorizedSnapshots" only sent on first request -

i started using "removeunauthorizedsnapshots" parameter lbapi avoid permissions errors experiencing. using lbapi gather details work items in our workspace faster wsapi, since have ~25,000 leaf stories in our workspace, data must gathered using more 1 api request. when adding "limit : infinity" parameter request, can see in network traffic while second request in fact made, "removeunauthorizedsnapshots" parameter not included, therefore resulting in permissions error. is there plan add official support parameter lbapi, rather adding request manually? thanks! in meantime, here solution uses "loadpage" function, in place of "load": var allrecords = []; function getworkitems(pagenumber) { ext.create('rally.data.lookback.snapshotstore', { fetch : ['name','objectid','planestimate'], filters : [{ property : '__at', value : 'curr...

javascript - Phonegap "phonegap build ios" command is not working -

Image
i new phonegap, , tried create simple phonegap application. after installation phonegap command line:--- i have created project when trying run phonegap build ios command error alert message coming there no script engine file extension ".js" in it. i using windows 7 , , installed node.js edit: adding image---- it might windows associating js extension wrong program. phonegap build process relies on extension being correctly associated in windows. try running command in command prompt: assoc .js=jsfile then try rerun build. original answer here: running javascript cscript?

php - CakePHP 2.4: Unwanted pre-filled form data -

i have form add new user. admin logged in may access form. unfortunately, username , password of admin filled form fields expected clear. , 1 strange thing is: username printed birthday field! i cannot explain myself how works. , not found in www post person has got same problem - found questions , answers pre-filled form data wanted. this view /users/add.ctp <h1>add new member</h1> <?php echo $this->form->create('user', array('url' => base_url.'/users/add', 'action'=>'post')); ?> <table class="form"> <tr><td>username:</td><td><?php echo $this->form->input('user.username', array('label' => false, 'div' => false, 'value' => ''));?></td></tr> <tr><td>name:</td><td><?php echo $this->form->input('user.name', array('label' => false, ...

c# - Resourse.designer.cs can't rebuild android Xamarin? -

Image
today trying make start in programming android in c# using xamarin. however, when go docs , follow example play audio ( here link audio docs) . when add line of code: _player = mediaplayer.create(this, resource.raw.test); i error: e:\android apps\hardcore_gabber_app\hardcoregabberapp\mainactivity.cs(48,48): error cs0117: 'hardcoregabberapp.resource' not contain definition 'raw' (cs0117) (hardcoregabberapp) and how have folders: and still cant find "raw". deleting recourse.designer.cs , rebuild not working. getting more errors , recourse.designer.cs not rebuilding. how can fix this? it seemed had add files manually adding right clicking on folder , press add files instead of drag , drop fix issue:

click event firing multiple times in jQuery plugin -

i using jquery plugin called printelement: http://projects.erikzaadi.com/jqueryplugins/jquery.printelement/ it's working on first click should upon further clicks (after closing pop window) continues pop windows. on second click pops 4 times, on third click i'm lucky enough 36 pop ups. each show after i've closed previous pop window. i've tried bind() , unbind() , event.stoppropagation() without change. here call it: $('a[href="#print"]').click(function(){$("body").printelement();}); and here plugin code: /// <reference path="http://code.jquery.com/jquery-1.4.1-vsdoc.js" /> /* * print element plugin 1.2 * * copyright (c) 2010 erik zaadi * * inspired printarea (http://plugins.jquery.com/project/printarea) , * http://stackoverflow.com/questions/472951/how-do-i-print-an-iframe-from-javascript- in-safari-chrome * * home page : http://projects.erikzaadi/jqueryplugins/jquery.printelement * issues (bug repo...

security - WebSphere Database Federated Repository -

i'm trying add db2 database repository federated repository. i'm using websphere version 8.0. i've been running through paul ilechko's instructions ( http://www-128.ibm.com/developerworks/websphere/techjournal/0701_ilechko/0701_ilechko.html ) , keep getting stuck @ step 3 (set repository using wsadmin command create wimdb tables). keep getting error: com.ibm.websphere.wim.exception.wimsystemexception: com.ibm.websphere.wim.exception.wimsystemexception: cwwim1999e exception occurred during processing: com.ibm.db2.jcc.db2driver i did search , says should set environment variable db2_jdbc_driver_path /home/.../sqllib/java/ scopes node=node, node=node01, node=cellmanager. i tested data source connection via console , worked, don't know did wrong. got ideas cause this? you can set required environment variable. move to: environment -> websphere variables set cell scope create db2_jdbc_driver_path

android - How to include activity inside a SherlockFragment -

hey guys have app i'm working on , have calculator , i'm able include layout inside fragmenttab2.xml don't know how or call calculator activity called cmainactivity.java cmainactivity.java package com.d4a.stzh; import java.text.decimalformat; import com.actionbarsherlock.app.sherlockfragmentactivity; import android.annotation.suppresslint; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.view.menu; import android.view.view; import android.view.window; import android.view.windowmanager; import android.view.view.onclicklistener; import android.widget.button; import android.widget.textview; public class cmainactivity extends sherlockfragmentactivity implements onclicklistener { private textview calculatordisplay; private static final string digits = "0123456789."; private boolean userisinthemiddleoftypinganumber = false; decimalformat df = new decimalformat("@###########"); calculato...

sql server - How can I increase the speed of many insert statements? -

i have .net project receiving data, processing it, , writing sqlserver database. let's have following code. private sub insertrecord(val1 integer, val2 integer, byref dbconnection data.sqlclient.sqlconnection) dim cmd sqlcommand = nothing if dbconnection.state = connectionstate.open dim strsql string = "insert mytable(value1, value2) values(@value1, @value2)" cmd = new sqlcommand(strsql, dbconnection) cmd.parameters.addwithvalue("@value1", val1) cmd.parameters.addwithvalue("@value2", val2) dim returnval = cmd.executenonquery() if not returnval 'do other stuff end if cmd.dispose() end if end sub sometimes need insert records - 500 per second. is, can handle around 200 inserts per second. there way combine multiple commands processed @ once? need know results of each insert statement. you need sql server bulk insert made available through sql...

listview - Ignore item in FileList Delphi -

i'm making simple file manager, using delphi. use listview show folders , files , use filelist (it's not visible) files , folders names directory. the problem want not include [.] element (it's symbol of current dir, don't know why delphi's filelist shows it) in listview. but, when try ignore it(here's code) procedure tfolderframe.showfiles; var i: integer; size: int64; filename, extension: string; begin edt1.text := currentfullpath; lvlistview.clear; fllstfiles.directory := currentfullpath; := 0 fllstfiles.items.count-1 begin filename := fllstfiles.items.strings[i]; extension := uppercase(extractfileext(filename)); size := dsifilesize(filename); delete(extension, 1, 1); if (filename <> '[.]') begin //error apperas @ line! if (not(isdirectory(filename))) begin lvlistview.items.add.caption := filename; lvlistview.items[i].subitems.add(inttostr(size)); lvlistview.items[i].su...

ios6 - I have an iOS 6 App I've been building not yet in the app store but I'd like it to be separate from the iOS 7 app? -

i read article/saw few posts app store backwards compatibility unfortunately app not yet in app store. company new ios7 go along new styles doesn't want time spent on autolayout/tweaking ios6. there way (without having 2 separate projects/apps) can upload build ios6 (and no longer work on project - i.e. it's legacy) , submit ios7 version users not yet on 7 see alert box letting them know have use 7 or can use older compatible version? thanks in advance! the new feature apple doesn't allow release app old versions, allows users (re)download old versions if current version doesn't support os. so, it's dead end solution because can't make updates old version. need consider effect has in terms of webservices app uses , things - can turned off if users still using old version of app intended stop supporting. you release 1 version 6 , goes live release 7 version, continue on 7 alone. it's better either explicitly start 7 alone or build app suppo...

sql - C# Approaches to accessing and displaying data from a table -

i need understand merits of using 1 method on another. simplify situation - have textbox.text needs display field database table. let's have table: table1 1 column, col1. i can either specify this, a) textbox1.text = table1["col1"].rows[1] or b) textbox1.databindings.add() method can give me comparison of these 2 alternatives, under circumstances should use 1 method on another? there others should aware of? know of linq, understand more alternative sql. one further aspect not understand. if wanted populate ten textboxes data table, might use like: for (int =0; i<10; i++) { textbox[i].text = table1["col1"].rows[i]; } how accomplished using approach (b)/databinding? thanks in advance help. think of databinding "dynamic" in object bound in control change if , when data changes. ideal binding situation bind once ( 2 way ) , forget it. in other example text set , never change unless explicitly change , likewise i...

Hosting SQL Database On-Line -

some software allows create own local database, database lost in event of local computer getting damaged. so question is: how create on-line sql database can queried software such ms sql management studio? you can pay companies host database, , give connection string access application or tool ssms. take @ examples below... azure host-it rackspace discount asp

c++ - Delete calling destructor but not deleting object? -

so have been working c++ , pointers year , half now, , thought had them succeed. have called delete on objects many times before , objects got deleted, or @ least thought did. the code below confusing hell out of me: #include <iostream> class myclass { public: int a; myclass() : a(10) { std::cout << "constructor ran\n"; } void method(std::string input_) { std::cout << param_ << "\n"; } ~myclass() { std::cout << "destructor ran\n"; } }; int main() { myclass* ptr = new myclass; ptr->method("1"); delete ptr; ptr->method("2.5"); } this code outputs: constructor ran 1 destructor ran 2.5 i confused why not throwing error of sort - expecting memory out of bounds exception or alike, nothing. for loop in there incase there sort of hidden garbage collection, though far know there no garbage collection in c++. can explain...

http - JBoss access log duration -

for jboss's accesslogvalve, have activated optional field, %d - time taken process request, in millis this has been super-valuable in showing responses took time. need details on how field calculated. specifically, when jboss stop "time taken process..." clock? example, jboss stop when [first segment of the] response given tcp/ip stack transmit client? or when client sends [ack] following last segment? or when network timeout occurs? knowing me find root causes crazy-long response times in our production access logs.

pseudo element - right-align CSS before: numbers? -

i want have numbered paragraphs without resorting using ordered lists. i'm trying accomplish using content:counter(paragraph) in css every paragraph block create generates number left of it. .pass { counter-reset:paragraph; } .pass p:before { content:counter(paragraph); position:absolute; font-size:0.6em; color:#999; margin-left:-3em; counter-increment: paragraph; } it works fine, problem can't figure out how align numbers align right. so instead of: 7 content 8 content 9 content 10 content i want them this: 7 content 8 content 9 content 10 content is there way accomplish without ol , li? set width :before class, text-align:right. http://jsfiddle.net/qax8m/ .pass {counter-reset:paragraph;} .pass p {padding-left:40px;} .pass p:before { content:counter(paragraph); counter-increment: paragraph; position:absolute; left:0; width:40px; text-align:right; }

java - Error while debugging an Android Widget -

i have android widget application. application this page (i downloaded source code). debugging widget user this tutorial . put 1 breakpoint in code (provided below). public static void pushwidgetupdate(context context, remoteviews remoteviews) { log.d("message", "fortunately, have come point"); componentname mywidget = new componentname(context, mywidgetprovider.class); //breakpoint here! appwidgetmanager manager = appwidgetmanager.getinstance(context); manager.updateappwidget(mywidget, remoteviews); } when begin debugging process, green debugging line shown on line breakpoint usual. after several seconds disappears, , see widget (or debugging process, or process on phone itself) has been terminated. process no more in process list in ddms perspective. why debugger stop? i have read on stackoverflow, debugging android apps better via logging ( log.d(string tag, string log_text) . so, have not found reason of error, started debug via logging...

scalability - Develop a distributed Full-Text search Index (AKA Inverted index) -

i know how develop simple inverted index on single machine. in short standard hash table kept in-memory where: - key - word - value - list of word locations example, code here: http://rosettacode.org/wiki/inverted_index#java question: now i'm trying make distributed among n nodes , in turn: make index horizontally scalable apply automatic sharding index. i'm interested in automatic sharding. ideas or links welcome! thanks. sharding self quite complex task not solved in modern dbs. typical problems in distributed dbs cap theorem , , other low-level , quite challenging tasks rebalancing cluster data after adding new blank node or after naturally-occured imbalance in data. the best data distribution implemented in db i've seen in cassandra. full text search not yet implemented in cassandra, might consider building distributed index upon it. some other implemented options elasticsearch , solrcloud . in example given 1 important detail missing w...

Jquery Accordion Menu not scrolling to anchor tags -

i have jquery accordion menu in footer working great, except fact when submenu opens... page not navigate anchor link. since in footer, forced scroll down see opened submenu. want page automatically scroll down. any ideas why isn't working? tried putting id within , didn't work. my html: <ul class="footer-offices"> <li id="#sanfran" class="one"><a href="#sanfran">text</a> <ul class="submenu"><li>office info here</li></ul> </li> </ul> jquery is: $(document).ready(function(){ $("ul.footer-offices li > a").on("click", function(e){ if($(this).parent().has("ul")) { e.preventdefault(); } if(!$(this).hasclass("open")) { // hide open menus , remove other classes $("ul.footer-offices li ul").slideup(350); $("ul.footer-offices li a").removeclass("open"); // open our new menu , ad...

excel - Expand on recorded "Text To Column" macro -

i trying (as learning functional macro) turn recorded macro following function. i error "no data selected parse" i think problem selection.texttocolumns destination:=cells(1, (cnum + 1)).select in second sub. don't know if "idel" problem way have written have not got past how change destination:=range("i1") where: cnum column parsed icol number of columns insert idel parsing delimiter isn in sheet number any insight helpful this fixed version2: (this last version ( did not know put array in "ftexetocolumn" gave try , worked) sub texetocolumn() '1st column parsed '2nd number of columns insert '3rd parsing delimiter '4th sheet number 'array set new col header names, add many name 2nd parameter equal ftexetocolumn "8", "3", "[", "2", array("new col name1", "new col name2", "new col name3") end sub sub ftexetocolumn(cnum long, ...

text - Adjust size of Dialogue Box with Apple Script -

Image
so have been using automator , built in actions pretty limited trying use applescript don't know how resize dialogue box display of text . i looked couldn't find how adjust parameters dialogue box there no size adjustment. the issue having getting automator display dialog. automator can display @ size fixed it. but other applications have different size values dialog windows. for example "system events". so can ask "system events" display dialog within ' run applescript ' action. tell application "system events" display dialog "so have been using automator , built in actions pretty limited trying use applescript don't know how resize dialogue box display of text . looked couldn't find how adjust parameters dialogue box have been using automator , built in actions pretty limited trying use applescript don't know how resize dialogue box display of text . looked couldn't find how adjus...

asp.net mvc - Cannot re-add view in a MVC4 razor project -

i unable re-add partial view after removing it. vs says file exists. checked .csproj , .sln file reference not find any. did clean of source tfs , still cannot add. know remove old references or whatever blocks addition? vs complaining file exists on disk, not in project. delete in windows explorer (or after clicking show files) , try again.

mysql - Error in SQL Syntax. What would be the proper solution or right syntax to use for a successful result? -

mysql said: #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '(14) not null ) engine=myisam' @ line 23 create table `activity_points` ( `fk_user_id` int( 10 ) not null default '0', `date` date not null default '0000-00-00', `points` int( 10 ) not null default '0', `lastupdate` timestamp( 14 ) not null ) engine = myisam ; timestamp shouldn't have length create table `activity_points` ( `fk_user_id` int( 10 ) not null default '0', `date` date not null default '0000-00-00', `points` int( 10 ) not null default '0', `lastupdate` timestamp not null ) engine = myisam ;

c# - Database Update doesn't work -

as in title. tried everything, searched on internet everywhere doesn't work. here's code: public void setip(string ip, string username) { try { string commandstring = "update `users` set `ip` = '@ip' 'username' = '@user';"; command = new mysqlcommand(commandstring, connection); command.parameters.addwithvalue("@ip", ip); command.parameters.addwithvalue("@user", username); command.beginexecutenonquery(); } catch (exception e) { messagebox.show(e.message); } } i correctly put both of values strings ip , username. username textbox , ip adress doing code: public string getip() { string direction = ""; webrequest request = webrequest.create("http://checkip.dyndns.org/"); using (webresponse response = request.getresponse()) using (streamr...