Posts

Showing posts from July, 2012

c# - Nonexistent ambiguous reference -

in visual studio 2010 project, had 2 identically named classes in 2 different namespaces both commonly included in viewmodels throughout application. 1 such class has since been deprecated , removed, i'm getting ambiguous reference error when directly referring remaining class, though old class no longer exists. we have this: using ournamespace.ui.common; using ournamespace.somewhereelse; // *snip* someclass.somemethod(); once upon time, both of above namespaces had someclass, deleted 1 in ournamespace.ui.common. however, when building, following error: 'someclass' ambiguous reference between 'ournamespace.ui.common.someclass' , 'ournamespace.somewhereelse.someclass' i've tried cleaning solution , rebuilding suggested in answers this ambigous reference question , continue see error. what's still lurking behind makes think deleted class still exists purposes of ambiguous reference? intellisense knows there's 1 now.

ios - Best approach to switch between TabBarController and ViewController -

Image
i have been trying app initial login screen takes tabbarcontroller . want know whats best approach example code appreciated. have tried unable switch viewcontroller tabcontroller . i'm not sure best way it, it's quick , dirty , works. present modal view controller inside applicationdidfinishlaunchinewithoptions: method. should replace @selector more appropriate want do. background color effect only. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; // override point customization after application launch. uiviewcontroller *viewcontroller1 = [[firstviewcontroller alloc] initwithnibname:@"firstviewcontroller" bundle:nil]; uiviewcontroller *viewcontroller2 = [[secondviewcontroller alloc] initwithnibname:@"secondviewcontroller" bundle:nil]; self.tabbarcontroller = [[uitabbarcontroller a

passing url as parameter in javascript is not calling the function -

<a href="javascript:void();" onclick="openwindow(2,1,4326,http://www.../images/icon_tree1.gif);">edit asset info</a> function openwindow not called , see folowing error on console uncaught syntaxerror: unexpected token : , uncaught syntaxerror: unexpected token ) this actual code using return "<a href='javascript:void();' onclick='openwindow(" 2 "," + 1 + "," + 4326 + "," + symbolurl + ");'>edit asset info</a>"; url address string, should surround quotes: ... onclick="openwindow(2,1,4326,'http://www.../images/icon_tree1.gif');" ...

javascript - Bootstrap Carousel pause -

i'm super new @ please gentle. i'm trying use bootstrap carousel plugin , have different div section display when each slide changes. found example unfortunately can't figure out how pause. <html> <head> <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-transition.js"></script> <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-carousel.js"></script> <style> .carousel { width: 80%; margin-left: auto; margin-right: auto; } </style> <t

php - nginx HTTP Error 500 when retrieving 1 Million rows -

using nginx 1.7 & php (laravel framework) retrieve 1+ million rows postgresql database causes error 500 displayed within 10 seconds. http error 500 (internal server error): unexpected condition encountered while server attempting fulfill request. i've set timeouts longer , reloaded nginx not working. settings prevent timeout? sites-enabled location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_read_timeout 6000; fastcgi_send_timeout 6000; client_body_timeout 6000; send_timeout 6000; proxy_read_timeout 6000; } to explain cryptic comment, , supply possible answer: this does not timeout , should make nginx issue 504 gateway timeout error. http error 500 means there error , i.e.: php (laravel) went out of memory the postgresql connection aborted the fastcgi process gave ghost so have 3 places check: fastcgi logs, laravel/php error log, , possibly postgres

asp.net - RadButton not causing postback -

i have radbutton on user control. when run site in debugger, , click button, doesn't cause postback, because page_init event doesn't fire. have set autopostback="true" , causesvalidation="false" bypass possible explanations. here radbutton code: <telerik:radbutton id="returnbutton" runat="server" text="return test" onclick="returnbutton_click" causesvalidation="false" skin="telerik" cssclass="rbclearbutton" width="175px" autopostback="true" > <icon primaryiconcssclass="rbprevious" primaryiconleft="4" primaryicontop="4"/> </telerik:radbutton> when view source, here is html generated: <a id="testmoduledetails_returnbutton" class="radbutton radbutton_telerik rbskinnedbutton rbclearbutton" href="javascript:void(0)" style="display:inline-block;width:175px;">&

arrays - Python: comparing columns in numpy -

i writing program creates file add_to_file function , program takes file input. the file has 4 columns: name, start position(s), description, end position(s) what program supposed do, read file numpy array , create plausible "motion-sequences" creating array have @ least 1 of end positions in motion same @ least 1 of start positions in motion follow def make_sequence(size,array): count = 0 sequence = [array[0]] result = [array[0,0]] row in array[1:size]: if row[1] == sequence[count][3]: sequence.append(row) result.append(row[0]) count += 1 else: pass return result what doing, it's taking array made file , making new array (result) such new array names of movements, movements next eachother flow because starting positions exact same ending positions of prior motion! here issue: some movements can start , end in variety of positions, , have written can take 1 starting , 1 endin

javascript - Background/content bottom half disappears when resizing/maximizing window -

so website http://developed-web.com/ starting come pretty i'm having issue that's not on-screen having disappear when take window out of maximized mode. this issue occurs in google chrome, firefox , ie 10 too. i'm not used kind of site structure don't wanna mess stuff more while trying fix this. issue be? thanks taking :) edit: go page in maximized window, , when take out of maximized (not minimize, make smaller) som content disappear: http://gyazo.com/a5744085b32b1cf05acc4e1efa653da9 you should familiarise debugging tools in browser. preference developer tools in chrome ( cmd+alt+i on mac, f12 on windows). there's great guide google here started. if @ console tab you'll see javascript throwing error in resizepanel method when resize window on home page. if @ elements panel , resize window see setting height of mask element size of window. to fix both errors, try updating code follows: $(document).ready(function() { $(

c# - Instantiate multiple classes from a single generic overide style class -

i looking way able instantiate multiple classes have same method. looking can pass in name of class string. here have far while compiles not run not instantiating class correctly. im doing know missing something. if can appreciate it. public class usemyclass{ public runmyclass(string st1, list<string> mysts, string myclass){ classprocessor cp = new myclass1(); // works classprocessor cp = new myclass2(); // works // here want able using string variable myclass (myclass1 or myclass2 ) string value //classprocessor cp = new class(myclass); // not work null classprocessor cp = (classprocessor)system.reflection.assembly.getexecutingassembly().createinstance(myclass); cp.mymethod(st1,mysts); } } file1: classproccessor.cs public interface classproccessor{ public void mymethod(string st1, list<string> mysts); } file2: myclass1.cs public class myclass1 : classproccessor{ public void mymethod(string

javascript - Can I determine whether clicking a link successfully opened a new window/tab? -

i have <input> element inside <a> element, meaning ie8 ignores <a> element's href attribute when clicked. works fine on other browsers. is there way determine whether new tab/window opened? can give user normal/ugly link click if didn't work. code example: <a target="_blank" href="http://somelink.com"><input type="button" class="standard_button_styling" /></a> what i've tried: remove <input> tag , style <a> tag: had trouble making other buttons (maybe due native browser styling) , don't want worse fix problem ie8. trigger link javascript window.open(): doesn't send referer_url in ie, , somelink.com in example relies on it. need have user click normal link. browser detection: ie8 , provide different response ie8, browser detection instead of feature detection regarded bad practice , i'd avoid if possible. you can try use <button> inste

c# - Windows Forms Threads are losing their culture -

we have .net 3.5 multi-threaded windows forms application. is launching 4-5 background workers/ async calls retrieve data. 1 in 10 times, 1 of threads throws following error. error null exception instead same exact call stack. have tracked issue down thread somehow losing cultureinfo. else ran this? system.threading.synchronizationlockexception: object synchronization method called unsynchronized block of code. @ system.globalization.culturetablerecord.getculturetablerecord(string name, boolean useuseroverride) @ system.globalization.culturetablerecord.getculturetablerecord(int32 cultureid, boolean useuseroverride) @ system.globalization.cultureinfo..ctor(int32 culture, boolean useuseroverride) @ system.globalization.cultureinfo.getculturebylcidorname(int32 preferlcid, string fallbacktostring) @ system.globalization.cultureinfo.inituserdefaultuiculture() @ system.globalization.cultureinfo.get_userdefaultuiculture() @ system.threading.thread.get_currentuicultu

ios - My CALayer transform holds after animation, but the perspective disappears -

Image
i have following code rotates calayer -45degrees on y axis: #define d2r(x) (x * (m_pi/180.0)) - (void) swipe:(uiswipegesturerecognizer *)recognizer { catransform3d transform = catransform3dmakerotation(d2r(-45), 0, 1.0, 0); transform.m34 = -1.0 / 850; cabasicanimation *transformanimation = [cabasicanimation animationwithkeypath: @"transform"]; transformanimation.fillmode = kcafillmodeforwards; transformanimation.removedoncompletion = no; transformanimation.tovalue = [nsvalue valuewithcatransform3d:transform]; transformanimation.duration = 0.5; [self.layer addanimation:transformanimation forkey:@"transform"]; } the animation works, except ends no perspective - ignoring m34 setting if i'm understanding things correctly. halfway through: at end: what doing wrong? animation affects appearance of view during animation. doesn't applied view after animation ends. need yourself. i'm guessing r

android - Ordered broadcast to Service -

i have use case service work on background , needs notify event 2 activities , 1 service . using ordered broadcast because: 1) if activitya on foreground, handles incoming event , aborts broadcast. way, activityb , service not notified. 2) in case broadcast not aborted, activityb next on line. cancels broadcast if active. 3) otherwise, service deals event. for that, there broadcastreceiver on each component different priority. service's broadcastreceiver inner static class , <receiver> declared in androidmanifest.xml proper <intent-filter> . the problem is, pointed out here , don't want eavesdropping broadcasts leaving custom actions on manifest, don't know other means of achieving ordering other using ordered broadcast. any other options? you try using android interface definition language communication instead.

C++ const static member array initialization -

i have class foo member variable bar big array of dynamic_bitset. make variable bar static sake of memory, const. value of bar stored in predefined file. should put code reading file , initializing bar? madsciencedreams's solution work, can more simply: in header class { static const vector<dynamic_bitset> s; public: // ... }; in implementation file vector<dynamic_bitset> loadbitsets() { //... return something; } const vector<dynamic_bitset> a::s(loadbitsets()); the move constructor should used automatically.

javascript - How can I insert a scrollbar in jquery jtable? -

i using great jquery plugin jtable . can't find examples showing vertical scrollbar. i tried setting height , overflow.auto on div contains - scrollbar scrolls whole table including header - want scroll rows not header , not footer. has found way this? a solution works way inserting: $('.jtable').wrap('<div class="jtable-main-container scroll-content" />'); and .scroll-content { overflow-y: auto; width:100%; } div.jtable-main-container { height:100%; } and setting height on div. scrolls table header - better scrolling whole jtable - tried make solution jtable generates 2 tables - 1 header , 1 body header gets out of sync. see here: http://jsfiddle.net/j5q4l/3/ $('.jtable').wrap('<div class="jtable-main-container scroll-content" />'); , .scroll-content { overflow-y: auto; width:100%; } div.jtable-main-container { height:100%; } thank you!

php - Tracing GET/POST calls -

is there way trace calls made web page when loading it? example went in video watching site, trace calls recursively until find mp4/flv file. know way follow urls recursively, solution not suitable , quite limitative( there's few thousand links, or links in file can't read). there way this? ideally, implementation in python, php c fine too you can use fiddler , wich extremely web debugger proxy.

nsstring - why does my objective c code keep saying data argument not used by format string -

-(void) timerrun{ secondscount = secondscount - 1; int minuts = secondscount /60; int seconds = secondscount - (minuts * 60); nsstring *timeroutput = [nsstring stringwithformat: @"%2d:.2d" , minuts, seconds]; countdownlabel.text = timeroutput; if (secondscount == 0) { [countdowntimer invalidate]; countdownlabel = nil; } } xcode telling me in nsstring line data argument not used format string , every time try run timer appears is: 2d:.2d knows objective c please on code. you're missing percent sign there, buddy. nsstring *timeroutput = [nsstring stringwithformat: @"%2d:.2d" , minuts, seconds]; .2d isn't replacement spec.

css - position:absolute !important does not work in Firefox -

my site my problem: in other browsers, can position slideshow absolutely appear within frame. in firefox page renders , firefox automatically puts slideshow position: relative . what code should be: top: 95px; left: 22px; position: absolute !important; what is: position: relative; top: 95px; left: 22px; why doesn't firefox support position: absolute in case? in css file, specifying position: absoulte !important #fadeshow1 might work #fadeshow1{position: absolute !important} also, in js/fadeslideshow.js , line: 48, setting.$wrapperdiv=$('#'+setting.wrapperid).css({position:'relative', visibility:'visible'.... try changing position value absolute

sqlite - Python sqlite3 string formatting -

i have function this: def func(self, id): self.cursor.execute("select * my_table id=?", (id,)) this works when pass integer value in id: obj.func(id=55) now might want reuse function so: obj.func(id="associated_id") where associated_id second column in my_table. doesn't work (it finds no results though there row id==associated_id). it works if change function so: def func(self, id): self.cursor.execute("select * my_table id=%s" % str(id)) why first version not work? there way solve problem using sqlite3.execute parameters instead of native python string formatting? in first case doing parameter binding. correct, sqlite libraries bind value 55 query call. in second case should not use parameter binding because sql equivalent to: select * my_table id='associated_id' because binding call detects passing string , treats internally string. when "select * my_table id=%s" % str(id) you don'

Download Java Class File & Run? -

okay, pretty i'm trying add security java class file. don't want decompiled. i've done created login system java app checks through web request. if login information correct run script. however, want further improve security , have class file hosted online. how can make download & run online hosted file? also, when app/script stops running or it's closed .class file deleted. i'd prefer did not have download file, online server , compile/run. create new urlclassloader (the "default" java classloader) , point @ wherever saved file: // directory you're saving .class file file tmpdir = new file("/tmp/yadda/blah/"); classloader cl = new urlclassloader(new url[] { tmpdir.touri().tourl() }, thread.currentthread().getcontextclassloader()); class<?> cls = cl.loadclass("supersecretclass"); // use reflection instantiate cls, call methods, etc. (passing in parent class loader might not necessary in non-webapp,

joomla - Combine multiple css files in one -

i have joomla! site , have set yoo theme template site slow because template has 30 external css files , approximately 20 script files. i have managed combine javascript files 1 component scriptmerge , css, component doesn't work should because messes site when combine of css files one. i have tried other components jch optimizer , jbetolo without success! does know component or plugin can job me? or else maybe, tried script combining in .htaccess , without success. you can use @import url'file' include each css file 1 include 1 file in main page. e.g. in site @import url("nav.css"); @import url("popup.css"); @import url("latestposts.css"); @import url("home.css"); this code placed @ top of common.css , common.css included index.php might want take here: http://www.w3.org/tr/css21/cascade.html#at-import

javascript - Rails Form Select Validation -

i want not accept <option value="">select one</option> in rails form. this code: <div class="field"> <p><%= f.label :category, "category:" %></p> <%= f.select(:category, [["-- select 1 --", "false"],'analytics','commerce','content management','gaming','green','media','social media','technology - software','technology - hardware', 'web']) %> </div> with jquery validation plugin: $(document).ready(function(){ $("input[name='commit']").click(function(){ $("#new_startup").validate({ rules: { startup[category]: { valuenotequals: "false" } }, messages: { startup[category]: { valuenotequals: "please select one" } } }); if ($("#new_startup").valid()) location.href = "#"; $("#tag").cs

hadoop - Pig group by and average function -

i have data looks this stn--- wban yearmoda temp dewp slp stp visib wdsp mxspd gust max min prcp sndp frshtt 030050 99999 19291029 46.7 4 42.0 4 990.9 4 9999.9 0 10.9 4 13.0 4 13.0 999.9 46.9* 44.1 99.99 999.9 010000 030050 99999 19291030 43.5 4 33.5 4 1015.4 4 9999.9 0 12.4 4 14.3 4 18.1 999.9 46.9 42.1 0.00i 999.9 000000 030050 99999 19291031 43.7 4 37.3 4 1026.8 4 9999.9 0 12.4 4 4.5 4 8.9 999.9 46.9* 37.9 0.00i 999.9 000000 030050 99999 19291101 49.2 4 45.5 4 1019.9 4 9999.9 0 6.2 4 8.2 4 13.0 999.9 51.1* 46.0 99.99 999.9 010000 030050 99999 19291102 47.0 4 44.5 4 1013.6 4 9999.9 0 7.8 4 6.2 4 8.9 999.9 51.1 44.1 0.00i 999.9 000000 030050 99999 19291103 44.0 4 36.0 4 1009.2 4 9999.9 0 10.9 4 8.0 4 8.9 999.9 50.0 42.1 0.00i 999.9 00000

html - PHP contact form emails to the email address, but 'name' field is empty? -

no, new form! i have set contact form page. emails me 'email address' , 'message' form fields, not send name filed value, blank. i cannot see have gone wrong. field names match php file. ideas i'm doing wrong? here code: <form id="form_28" name="website_query" action="mailform2.php" accept-charset="utf-8" method="post" target="_self" enctype="multipart/form-data" style="margin:0;position:absolute;left:231px;top:242px;width:343px;height:229px; /*maindivstyle*/" __addcode="here"> <!--maindivstart--> <!-- html frame - name txt_31 --> <!--preamble--> <div style="position:absolute;left:8px;top:8px;width:51px;height:18px;overflow:hidden; /*borderdivstyle*/" __addcode="insideborderdiv"> <!--borderdivcontents--> <p class="wp-body-p"><label for="edit_1"><span class="body-c&q

c++ - Block Matrix Multiplication -

i want perform block matrix multiplication(divide matirix multiple sxs matrices , multiply corresponding blocks). have written code following sample code of architecture book of hennesy: for(int jj=0;jj<=(n/s);jj += s){ for(int kk=1;kk<=(n/s);kk += s){ for(int i=1;i<=(n/s);i++){ for(int j = jj; j<=((jj+s-1)>(n/s)?(n/s):(jj+s-1)); j++){ temp = 0; for(int k = kk; k<=((kk+s-1)>(n/s)?(n/s):(kk+s-1)); k++){ temp += b[i][k]*a[k][j]; } c[j][i] += temp; } } } } here, nxn size of original matrix. a, b matrices of same size. dividing a,b matrices blocks of size sxs. in program, have given block size 4. put elements of a, b 5, constant , n = 1000. however, ge

ios - Create UIView with custom shape -

so wondering if there's way make uiview custom shape. i'm trying make piano keyboard when user touches view delegate method responds playing noise. picture .png picture of key , transparent background. thanks in advance. you can't make uiview in shape of, say, triangle, can make view transparent, add non-transparent content it. for example , make view background of png (with, assume, partially transparent areas) make transparent uiview , add image view it. better yet , use uiimageview in place.

php - sending message out of a sandbox to a custom application -

i got application uses flash it's interfaces, , want extract information application, , parse/use in own application (which processes data, stores essentials in mysqldb , on). .swf files written in as2 , can modded quite easily. so goal send information (really information. being able send numbers (of @ least decent size) enable me implement own protocol of encoding , partitioning) means, not picky means. here current approach (not own idea, credits koreanrandom.org. merely use source learn): use dokanlib mount virtual filesystem (and implement getfileinformation -handler) use loadvars inside as2-environment parameters "../.logger/@encoded_information" since getfileinformation gets accessed filename parameter, can decode it, put several ones (if had splitted, windows not seem filenames several hundred characters length) , use decoded data however, application causes bluescreens quite (dont ask why. got no clue, bluescreen messages different) , devs @ k

Avoid regex to capture contents of string (between quotes) -

i'm using following regex capture array of string follows conditions (e.g.: it's not prepended letter or number, , contains strings surrounded single or double quotes): /^?[ =>]\[(('|")[^('|")\s]*('|")(, ?)?)+\]/ it should capture ["bla", "ble", "blo"] however, should not capture that, if it's part of string between (single or double) quotes: '["bla", "ble", "blo"]' what should add avoid capturing unwanted case? add negative lookbehind/lookahead expression pattern: (?<!['])(?!['])(\[(('|")[^('|")\s]*('|")(, ?)?)+\]) worked me when testing, may depend on regex engine.

Why is the permalink decorator no longer recommended in django? -

i reading django dev documentation. here says permalink decorator no longer recommended, use reverse inside get_absolute_url method generate full url model instance(scroll little above , check out warning box). i think violating dry have use reverse each , every time need it. what's wrong using permalink? why no longer recommended? in current versions of django, decorator literally calls reverse function documentation recommends anyway. reason seems decorator unnecessary have reverse() . using reverse nicer returning name, tuple, , dictionary. instead, use args , kwargs - idiomatic python. and this ticket discussed deprecating decorator api purity sake. instead of raising warnings , making users update code bases, decided put warning in docs. the permalink decorator should deprecated , removed. introduced solve problem of having hardcode urls get_absolute_url. violates 1 of major rules of decorators in in forces function signature change in order deal f

C# console program questions regarding instantiation and use of static fields -

c# newbie here. took test asked out put of c# code was. don't have exact code i've tried recreate memory below. code doesn't compile reason(not important since have questions happening here). part had issues trying remember lines creating class fields. here questions: is creating new instance of class using "new class1();" without assigning variable valid way instantiate it? each time class instantiated how static fields handled? can create class fields calling constructor? using system; using system.collections.generic; namespace customfunctiontest { class program { static void main(string[] args) { new class1(); new class1("e"); } } public class class1 { public static class1 test1 = new class1("a"); private class1 b = new class1("b"); public static class1 c = new class1("c"); public class1() {

c# - getting security warning in facebook authentication -

Image
i getting security warning while using authentication in facebook app.my code shown screenshot security warning private void imagefacebook_tap(object sender, gestureeventargs e) { facebookblocker.visibility = visibility.visible; pop_up.isopen = true; //get facebook string appid = "my facebook app id"; var parameters = new dictionary<string, object>(); parameters["client_id"] = appid; parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html"; parameters["response_type"] = "token"; parameters["display"] = "touch"; string extendedpermissions = "user_about_me,read_stream,publish_stream"; // add 'scope' if have extendedpermissions. if (!string.isnullorempty(extendedpermissions)) { // comma-delimited list of permissions parameters["scope"] = extendedpermissions; } var

hyperlink - hovering over one link makes tiny dash appear to right of it -

in case, hovering on left link makes tiny dash appear right (between 2 links). how can rid of this? see in safari , chrome both, don't see in style sheet make this. <!doctype html> <html> <head> <meta charset="utf-8"> <title>walls</title> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <link rel="stylesheet" href="custo.css"> <script src="prettyphoto_compressed_3/js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="prettyphoto_compressed_3/css/prettyphoto.css" type="text/css" media="screen" charset="utf-8" /> <script src="prettyphoto_compressed_3/js/jquery.prettyphoto.js" type="text/javascript" charset="utf-8"><

Android button background not loading when running the app -

i had set background images of buttons(separate ) 4 of them in main menu having sizes of 640*150 , 320*75 , 160*38.5 in drawable hdpi, mdpi ldpi folders respectively. earlier had used 100*100 background buttons , worked properly. the graphical layout shows changes have made when run app in emulator or mobile blank background. please help. have tried reinstalling ,cleaning , running in debug problem exists. got it.. had set button_pressed.xml changes button background n click which changed default background configuration

Eclipse build "current project" works from menu but not with shortcut -

i have assigned ctrl-f7 "build all", works fine. however, since project consists of subprojects, don't want compile while i'm working on library part, dependent projects fail anyway. i assigned shortcut f7 "build project", doesn't anything. when use menu "project -> build project" builds part i'm working on. can see in menu shortcut assigned, because shown there, doesn't trigger when press it. is bug in eclipse (juno 4.3.0) or missing here something? in shortcut editor "where" clause set "in windows", same "build all" shortcut. tried set c++ editor , others, none seem work. i still in eclipse indigo, , have assigned f7 build project. works. there maybe regression because found bug : https://bugs.eclipse.org/bugs/show_bug.cgi?id=383497 read bug see if find solution. try maybe clean 1 time eclipse. start eclipse -clean or add in shortcut (don't forget remove parameter after, becaus

android - Get the Json Array data in listview -

i got problem json array data, have tried following code using can json response in listview getting single data in response getting single item why? here code: url = "some url"; httpclient mhttpclient = new defaulthttpclient(); httpget mgetmethod = new httpget(url); httpresponse mreponsemessage = mhttpclient.execute(mgetmethod); string response = entityutils.tostring(mreponsemessage.getentity()); log.d("tag", "o/p response " + response); jsonarray responseobject = new jsonarray(response); system.out.println("responseobject="+responseobject); for(int i=0; i<responseobject.length(); i++) { obj = responseobject.getjsonobject(i); } here json response [{"dmessage":"sfsfs","message":"sfsf","mp3":"kalimba.mp3","user_message_id":"85","category":"lottery","title":"dgfs"},{"dmessage&qu

Github pages & jquery cookie; state saved on page level only -

so put old project on github. in php , had cookie magic when "invert" colors stay through site. saved rendered html version of the site github , switched cookie magic jquery.cookie work without server-side component there's link site below. http://reggi.github.io/csi-bp so seems github pages set cookies on page-level , don't seem transfer between pages. case? i'm curious i'm missing. i know switched domain github.com github.io cookie / security purposes, didn't know going result in this. it side effect of newest security measure github (april 18th): " content security policy " content security policy new http header provides solid safety net against xss attacks. blocking inline scripts , limiting domains other scripts can loaded from .

Unable to implement textwatcher correctly in android -

hey guys looking way find out user typing in edittext , stumbled upon textwatcher . problem don't understand parameters refer in function. want keep track of text being entered user letter letter. can't figure out argument correct subscript no. have tried different variations haven't had luck those. essentially want save text entered in array until user presses ','button or exceeds limit of 24 characters. please advise. public class main extends activity implements onclicklistener { // inputans.setonkeylistener(this); button go; textview answer; textview check; edittext inputans, inputq; boolean done1 = false; char[] ans = new char[30]; string predef = "please answer question"; char[] predefc = predef.tochararray(); int len = predefc.length; int = 0; char[] substring = new char[30]; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

ruby - Undefined method `strftime' for nil:NilClass -

i have variable: @delivery_time . when this o.delivery_time.strftime("%h:%m:%s") it gives undefined method `strftime' nil:nilclass and when this: debug o.delivery_time it gives: --- 2000-01-01 11:00:00.000000000 z ... also, output for: o.delivery_time is 2000-01-01 11:00:00 utc here want value of time i.e. 11:00. tried srtftime not working. can in this? i have same kind of issue , following code helps me display hour , minutes field "time". o.try(:delivery_time).try(:strftime, ("%h:%m"))

concatenation - How to add A through Z at the end of a string PHP -

what doing taking vehicle vin number , taking last 6 digits of , storing stock number. issue have have function goes , checks database make sure stock number exists. if (can have same vehicle in inventory again buy back, etc) want concat @ end of sting through z. if(strlen($vin) > 9) { $stocknum = substr($vin,-6); while(verfiyunique($mysqli, $stocknum) != true) { if(strlen($stocknum < 7)) { $stocknum = substr($vin,-6) . "a"; }else{ ? } } return $stocknum; how increment lets b or b c if match? thanks in advance help! you increment ascii number , use chr() function convert relevant character. e.g.: chr(65) output a see http://php.net/manual/en/function.chr.php more info link ascii table.

bash - Deleting Inactive 5 days Old Files -

my aim delete more 5 days old files no longer used process. starter have written following script, not work, says line 10 command not found. home=~/var cd $home f in `find . -type f`; if [`lsof -n $f`]; echo $f fi done hmm ye not being done try this: #!/bin/bash dir=$home/var ########################################################## ## files older 5 days , recursive value set 1 # f in $(find $dir -mtime +5 -maxdepth 1 -type f); ########################################################## f in $(find $dir -type f); # run lsof , pattern a-z send dev null lsof -n $f |grep [a-z] > /dev/null # if found exit status 0 or success if [ $? = 0 ]; echo "$f in use -->" else echo "file $f not in use" fi done in script had defined home ~/var - using squigly line in scripting try , stay away from. secondly changing environment var

ide - How to get Sublime 2 to work with Python 2.7 -

im sorry guys dont extactly understand how sublime interect python on machine. can help. the error when ctrl-b follows: [error 2] system cannot find file specified [cmd: [u'python', u'-u', u'c:\users\user\appdata\roaming\sublime text 2\packages\user\default (windows).sublime-keymap']] [dir: c:\users\user\appdata\roaming\sublime text 2\packages\user] [path: c:\program files\common files\microsoft shared\windows live;c:\program files (x86)\common files\microsoft shared\windows live;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files\intel\wifi\bin\;c:\program files\common files\intel\wirelesscommon\;c:\program files (x86)\windows live\shared;c:\program files (x86)\common files\roxio shared\dllshared\;c:\program files (x86)\common files\roxio shared\10.0\dllshared\;c:\program files\widcomm\bluetooth software\;c:\program files\widcomm\bluetooth software\syswow64;c:\

oop - Java generics and typecasting -

i have badly created container object holds values of different java types(string, boolean etc ..) public class badlycreatedclass { public object get(string property) { ...; } }; and extract values in way string mystr = (string) badlycreatedobj.get("abc"); date mydate = (date) badlycreatedobj.get("def"); i forced write new code using object , trying see if there clean way this. more method below preferred ? explicit cast string mystr = (string) badlycreatedobj.get("abc") date mydate = (date) badlycreatedobj.get("def"); using generic cast public <x> x genericget(string property) { } public string getstring(string property) { return genericget(property); } public date getdate(string property) { return genericget(property); } using class.cast <t> t get(string property, class<t> cls) { ; } i have gone through several related questions on java generic function: how return generic t

c++ - Failed to clean when building wxwidgets using MinGW -

i have problem when cleaning wxwidget using mingw. last error : make (e=2):system cannot find file specified. mingw32-make : *** [clean] error 2 and seems of errors same 1 posted above, , errors can seen start of cleaning process (after typing mingw32 clean instruction). do know how solve this? i have followed every step mentioned in wxwidgets wiki , other wiki explain way install this. of course didn't install msys or mentioned in wiki, mingw (and code::blocks, both of them installed separately). btw, using latest stable mingw (3.8x) , version of wxwidgets getting problem 2.9.4. any appreciated. sorry bad english :)

image - Style CSS does not With CodeIgniter - Baseurl -

this question has been asked several times, have not found right answer work on project. my css file liking <link rel="stylesheet" type="text/css" href="assets/css/style.css"/> the css file in: -main_directory -application -assets -css -style.css -system i tried link css using base_url href="<?php echo base_url('assets/css/style.css');?>" doesn't work me. so problem? can help? your structure should this myproject application assets css style.css system autoload url helper in config/autoload.php $autoload['helper'] = array('url'); now <link href = '<?php echo base_url()?>/assets/css/style.css'> this should work. make sure spellings correct , see casd sensitive issue if using linux.

Blackberry :- Background Thread with ui -

i have worked on app birthday reminder. here need ui , background thread simultaneously: thread starts running after installing app , running in background, not affected ui. opening or closing ui should not affect thread. runs until app uninstalled. thread checks updates in database every 1 minute, silently in background . the problem when close ui, thread stopped automatically, , when again open app ui, starts again. why this? want thread running..

jasper reports - Error filling print... java.lang.String cannot be cast to java.lang.Number -

i trying sample report. connected database successfully. i wrote simple query select country, population dataset desc dataset; | country | varchar(25) | yes | | null | | | population | int(9) | yes | | null | | i have taken blank chart , in used xy line chart. x-axis have given country , y-axis population . when click preview button, getting below error. error filling print... java.lang.string cannot be cast to java.lang.number java.lang.classcastexception: java.lang.string cannot be cast to java.lang.number at net.sf.jasperreports.charts.fill.jrfillxyseries.evaluate(jrfillxyseries.java:159)      at net.sf.jasperreports.charts.fill.jrfillxydataset.customevaluate(jrfillxydataset.java:121)     at net.sf.jasperreports.engine.fill.jrfillelementdataset.evaluate(jrfillelementdataset.java:155)      at net.sf.jasperreports.engine.fill.jrcalculator.calculatevariables(jrcalculator.java:160)      at net.sf.jasperreports.engine.fill.jrvertical

javascript - can't understand why i receive uncaught reference error function -

i'm trying launch javascript function php initialize module. here code: <?php defined('_jexec') or die('direct access location not allowed.'); $paramarray[]='advisualv2jmodphp_ver'; $paramarray[]='0.3.0070'; // 000 $paramarray[]='station_id'; $paramarray[]=$params->get('station_id'); // 001 $paramarray[]='verbose'; $paramarray[]=$params->get('verbose'); // 002 $paramarray[]='bk_colorodd'; $paramarray[]=$params->get('bk_colorodd'); // 003 $paramarray[]='bk_coloreven'; $paramarray[]=$params->get('bk_coloreven'); // 004 $paramarray[]='ink_colorodd'; $paramarray[]=$params->get('ink_colorodd'); // 005 echo 'avviamo la procedura 0.0.095 - '.$station_id.'<br><br>'; echo '<div id="tabellaeventi"></div>'; $paramarray = json_encode($paramarray); $paramarray = htmlentities($paramarray); echo "<

php - Prevent auto html entities in wordpress -

apache 2 php 5.2.9 mysql 5.077 wordpress 3.5.1 after installed wordpress, chose theme named 'sliding door'. then, turned write front page. after finished , pressed 'publish', raw html content turned html entities, this: when edit in text editor, not visual editor: this example page.it might this: <blockquote> after press 'publish', still in text editor: this example page. might this: &lt;blockquote&gt; this happened when wrote posts , text widget , global configures preventing me submit html codes. converted content plain text automatically. weird. is there wrong apache? or wrong php? or wrong wordpress? or mysql? i find solution. php filter changed content. solve it, changed ' filter.default ' variable in /etc/php.ini ' special_chars ' ' unsafe_raw ', , restarted httpd.

lucene.net - Search for two-letter words in Lucene -

i'm trying find documents containing acronym "it". i've tried searching using standardanalyzer, simpleanalyzer , keywordanalyzer - same result (no hits whatsoever). as far can see, "it" isn't part of default stop words? i can find documents using wildcard search, know they're in index. any appreciated! cheers! i tried re-indexing without any stop words... new indexwriter(directory, new standardanalyzer(version.lucene_30, new hashset<string>()), // no stop words true, indexwriter.maxfieldlength.unlimited); ...and after able search " it " long used same type of analyzer (without stop words) searching: new standardanalyzer(version.lucene_30, new hashset<string>()

python - pytz: _utcoffset has a wrong value for Iran -

correct value: >>> pytz.timezone('asia/tehran').utcoffset(datetime(2013, 1, 1)).total_seconds()/3600.0 3.5 >>> pytz.timezone('asia/tehran').utcoffset(datetime(2013, 1, 1)).total_seconds() 12600.0 incorrect value: >>> pytz.timezone('asia/tehran')._utcoffset.total_seconds()/3600.0 3.433333333333333 >>> pytz.timezone('asia/tehran')._utcoffset.total_seconds() 12360.0 i wonder if _utcoffset attribute used in utcoffset() method, why method working while attribute wrong. looks bug anyway. nothing changes if replace asia/tehran iran >>> print pytz.version 2012c os: linux mint 15 (olivia) using python 2.7 let's see what's going on here: >>> tz = pytz.timezone('asia/tehran') >>> tz <dsttzinfo 'asia/tehran' lmt+3:26:00 std> this means timezone expressed in lmt - solar time. that's why see utcoffset of 12360 - no error here, it's