Posts

Showing posts from March, 2013

php - How to make sure a page appears once the iFrame on the page has loaded first -

i'm pretty new world of web developing , web design in php, hoping me question. i loading particular page on php powered website loads iframe page elsewhere in center of page. wondering if knows how whole page load once iframe has loaded. it's matter of further 1 or 2 seconds before iframe loads, needs professional possible. i'd appreciate help. i'd assure guys although first question, know how stack overflow works 1 of best friends contributors here , he's telling me how annoying when people don't respond or give points answers, i'd assure that. thanks again. steve. use jquery. won't able in php, it's client side issue. function calliframe(url, callback) { $(document.body).append('<iframe id="myid" ...>'); $('iframe#myid').attr('src', url); $('iframe#myid').load(function() { callback(this); }); } see: jquery .ready in dynamically inserted iframe

Python to insert a line at a random location of a large text file with condition -

i have 30000 plus line text file need modify using python. want following: there specific keyword1 in file has device name following keyword1. need identify keyword1 in lines , retrieve device names, store them in list later use i have achieved using regular expression once have device names list, need insert newline "fixed format + device name" file @ series of specific locations following keyword2 this run problem. originally used simple counting method. pattern.search(line) throughout file , once keyword1 identified, locate inserting location counting + 5, index of line keyword1 identified. however, turns out line order in file matter need insert newline after line keyword2 located. what's more troublesome keyword2 exists everywhere in file. keyword2 within 7 lines after keyword1 needs considered. to give example: random line keyword2 <--- keyword2 not considered random line random line random line, keyboard1 "device name&quo

c# - Reading special characters from URL query string -

i have situation user able enter characters want in url query string. example: http://localhost/default.aspx?id=a ‡jljglkjg how can accept special characters such ‡, ˆ, , † in asp.net url query string? finding when attempt retrieve these url query string these special characters gets replaced “?”. note: user inputs these query string url. this url wrong according rfc . if using browser, ecndoing required. if done javascript, use encodeuricomponent if c# app, using httputility.urlencode here

Android: InflateException on composite component -

i'm creating pretty complex composite component throws inflateexception unknown cause. able replicate error in simplified version below, component 2 text views. in identifying error or tracking down appreciated. composite_component.xml <?xml version="1.0" encoding="utf-8"?> <com.cc.compositecomponent xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:text="one" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <textview android:text="two" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </com.cc.compositecomponent> compositecomponent.java package com.cc; import android.app.activity; import android.content.context; impo

Jquery validation plugin question -

i need validate account number, can either 6 number (111111), or 2 letter 6 numbers (xx111111). can please show me how it? thank you. as @teja says, need use .addmethod regular expression. believe should work: $.validator.addmethod("accountnumber", function(value, element) { return this.optional(element) || /^(\w{2})?\d{6}$/.test(value); }, "please enter valid account number"); $("#form").validate({ rules: { account: { accountnumber: true } } }); example: http://jsfiddle.net/andrewwhitaker/tuab7/

Adding many circles to a google map -

i'm attempting draw many circles (around 1000) on google map, @ various locations , sizes, , binding click event them. many calls of new google.maps.circle(parameters); makes page loading slow, , hangs forever, i'd figure out if there's better/faster way accomplish i'm trying do. i see there's called kml layer, there doesn't appear easy way draw filled circles , i'm not sure if can still bind click events each individual circle in layer or not. looking @ circle workaround on google kml faq page, i'm not sure if generating kml file contains thousands of circles similar end saving time. i have no idea how go generating kml file. finally, take consideration i'm pulling circles i'm attempting draw database, i'd either have generate kml file on fly use or generate new file every time circle removed or added db file stays date. of course, if there's alternative, i'm ears! with of others via google maps api v3 group

ios - XCode project type for this application? OpenGL ES or View-Based? -

i wondering project type application developed using? the app called sound literacy. http://www.youtube.com/watch?v=i7gian5t7ww&feature=related i'm new developing, want create application uses these same features. i'm thinking either opengl es application or view-based. guys think? thank in advance! the "project type" doesn't matter. give different boilerplate code start with. start whichever 1 seems convenient you.

javascript - Populating an IndexedDB with .csv file data -

how populate indexeddb csv file? can't find simple guide anywhere online. here example of 1 of csv files want use, they're pretty that: http://www.mediafire.com/?hlx2tpacw5dqat5 first column (row 2 down) timestamp (ms excel), column 2 (row 2 down) amount of readings, other columns temperature readings. 900 above indicates time interval in seconds between readings. final reading in row null , should disgarded( or taken) away number of readings. therefore, first reading in row taken @ time of rows timestamp minus (900 seconds multiplied (number of readings in row minus one)). in case of first value on first row value taken @ (40271.0625-(0.00024*900*(1024-1))). what i'd have 2 columns, speak, in indexeddb. 1 time of reading (obviously these unique) , 1 temperatures. ideas? appreciated! thanks you can use alasql javascript sql database library. has special operators loading data txt, csv, tab, xls, , xlsx files. works indexeddb. in example need add alas

Why doesn't VIM recognize a color totally available? -

this mystery drives me crazy: trying specify colors are listed inside gvim 7.3 when running this script . but when put in .vim syntax file, gvim issues error "color name not recognized". happens simple colors orange . instead, recognizes few colors red, blue, yellow, darkyellow, darkgreen, black, etc. why happen , how workaround this? because, terminal program vim supports ansi colors default. http://en.wikipedia.org/wiki/ansi_escape_code#colors i don't know enough syntax files answer, these links might useful http://vim.wikia.com/wiki/256_colors_in_vim http://vim.wikia.com/wiki/view_all_colors_available_to_gvim it's possible normal colors available syntax files there can use different color scheme reassign normal colors. http://vimcasts.org/episodes/creating-colorschemes-for-vim/

javascript - hide textfields instantly when check a radio button -

what want when user chooses first option textfield disappear , when users chooses second textfield appear again instantly. here's code: <input type="radio" name="radiogroup0" value="1" id="student" /> <input type="radio" name="radiogroup0" value="0" id="not student" /> and want hide/show this: <label for="department">department:</label> <input name="department" type="text" class="label" value="" /> i have tried i'll appreciate answer on click , keyup , , change events, show or hide appropriate elements (jquery makes easier). reason handling events value change may triggered after element loses focus. happy coding.

mysql - PHP Search Engine -

i have put complicated search form. using arrays have managed searching checkboxes. if(isset($_post['search']) && !empty($_post['search'])){ foreach($_post['search'] $key=>$value){ if($value==1) $search[] = "$key"; } $searchstring = implode(' , ', $search); } $query = "select candidate_id.master_id, candidate_contact_details.first_name, candidate_contact_details.last_name, candidate_contact_details.home_phone, candidate_contact_details.work_phone, candidate_contact_details.mobile_phone, candidate_contact_details.email candidate_id, candidate_contact_details, qualifications, security_experience, previous_career qualifications.active = 'finished' , candidate_id.master_id = candidate_contact_details.c_id , candidate_id.master_id = qualifications.c_id , $searchstring"; i know how searches of database specific term. ie. postcode field know how can add query? know how either checkbox based searches

cocoa - Checking private network for local devices with a certain port open (iPhone/Objective C) -

i've spent whole day creating system between mac , iphone have used cocoaasyncsocket create listen server on mac , client on iphone. basic idea leave app on mac running while computer on , when wish transfer data iphone app, fire app connects , sends data... have system working how want function have 1 issue have been trying solve 4 hours in total! i wanted create scans wireless network mac listener running... thought simple, wrong. have searched high , low no luck on case , using stackoverflow last resort. my current plan "autoscan" retrieving internal ip of iphone (ie 192.168.1.94) use figure out other ip's on network (192.168.1.0-254), know ip's scan can loop through each 1 , check see if port open/i response. now want quick possible haven't been able give me accurate results... using connecttoaddress:error: in cocoaasyncsocket return true every 1 of 255 different ip addresses, other reachability functions have come across... have read because

c# - Setup Project and script folder moving -

i include javascript include folder in root directory of setup project in application folder. tried move javascript include file under javascript folder , get: unable find source file 'c:\documents , settings\support\my documents\projects\u2server\wwwroot\ckeditor\ckeditor_basic_source.js' file 'ckeditor_basic_source.js', located in '[targetdir]\wwwroot\scripts\ckeditor', file may absent or locked. i can delete the directory , add files 1 one on 200 files in include directory. easy way move folder in application folder of file system view of setup program? when moving files on disk need update setup project. simplest approach remove entire folder in setup project file system editor , add again in correct location. way use correct paths.

network programming - How to read a FSM diagram -

Image
how take diagram , translate useable program. i'm not sure how read diagram. if kind of walk me through, maybe show example of code , how relates diagram, great. thanks! circles text inside states. text describes state is. dashed arrow points starting state. outgoing arrows determine state change. beside of arrow text divided line upper part , lower part. lower part actions should take place when arrow transition executed. upper part conditions. when true - transition executed (and lower part). lambda symbol means should nothing except changing current state when transition takes place. so lower parts have coarse corresponding functions. , upper parts points should wait conditions - polling or async waiting pending i/o packets, whatever. here pseudo-code similar c (i've written here not assume works or compiles): enum state { waitfor0call, waitforack0, waitforcall1, waitforack1 } int main() { state state = waitfor0call; while (1) { swit

how to get redirected to a method at login/logout before target-url called in spring-security, spring mvc -

i trying record current time of login(in method or object) once login successful , assign lastlogin time current login time @ logout. using spring security login, logout. don't know how take control method before goes target-url. spring-security.xml - <security:form-login login-page="/login" login-processing-url="/home/currenttime" authentication-failure-url="/login?error=true" default-target-url="/home"/> <security:logout invalidate-session="true" logout-success-url="/home/copylastlogintocurrentlogintime" logout-url="/logout" /> controller - /home - @requestmapping(value = "/currenttime", method = requestmethod.get) public void recordcurrentlogintime(model model) { //code record current time } @requestmapping(value = "/copylastlogintocurrentlogintime", method = requestmethod.get) public void changelastlogintime(model model) {//code copy

c# - Using Regular Expressions for Pattern Finding with Replace -

i have string in following format in comma delimited file: sometext, "text with, delimiter", moretext, "text again" what need create method through string, , replace commas inside of quoted text dollar sign ($). after method, string be: sometext, "text with$ delimiter", moretext, "text again" i'm not entirely regex, know how can use regular expressions search pattern (finding comma in between quotes), , replace comma dollar sign. personally, i'd avoid regexes here - assuming there aren't nested quote marks, quite simple write for-loop, think more efficient: var inquotes = false; var sb = new stringbuilder(sometext.length); (var = 0; < sometext.length; ++i) { if (sometext[i] == '"') { inquotes = !inquotes; } if (inquotes && sometext[i] == ',') { sb.append('$'); } else { sb.append(sometext[i]); } }

c++ - Creating an instance of a class with () -

i have question : constructor used when create instance of class classname instance() in c++ ? example: #include <iostream> using namespace std; class test { private: test() { cout << "aaa" << endl; } public: test(string str) { cout << "string = " << str << endl; } }; int main() { test instance_1(); // instance_1 created... using constructor ? test instance_2("hello !"); // ok return 0; } thanks ! tricky! expect compilation fail default constructor private. however, compiles , nothing created. reason? test instance_1(); ... function declaration! (which returns test , takes nothing.)

struts2 - Missing ActionValidatorManagerFactory In Struts 2.2.3? -

has actionvalidatormanagerfactory been replaced in struts 2.2.3? i'm trying write unit test test validation logic, , can't find class. yes, removed time ago in favor of dependency injection approach. this may out: http://www.mail-archive.com/dev@struts.apache.org/msg31637.html

java - What is the difference between the 'shell' channel and the 'exec' channel in JSch -

i want able send many consecutive command represented strings within java application ssh server execution. should use: channel channel = session.openchannel("shell"); -or- channel channel = session.openchannel("exec"); with shell channel shell (on unix it's sh or bash or that, on windows it's cmd.exe) started , console created (the same see on screen if run them locally). have prompt can parse or use detection of completion of command. with command channel shell instance started each command (actually channel opened each command) , command passed parameter shell (on windows "cmd.exe /c ". it's easier use command channel cause don't need deal command prompt.

c++ - I tried: valgrind, _GLIBCXX_DEBUG, -fno-strict-aliasing; how do I debug this error? -

i have strange error i've spend several days trying figure out, , want see if has comments me understand what's happening. some background. i'm working on software project involves adding c++ extensions python 2.7.1 using boost 1.45, code being run through python interpreter. recently, made change code broke 1 of our regression tests. regression test sensitive numerical fluctuations (e.g. different machines), should fix that. however, since regression breaking on same machine/compiler produced original regression results, traced difference in results snippet of numerical code (which verifiably unrelated code changed): c[3] = 0.25 * (-3 * df[i-1] - 23 * df[i] - 13 * df[i+1] - df[i+2] - 12 * f[i-1] - 12 * f[i] + 20 * f[i+1] + 4 * f[i+2]); printf("%2li %23a : %23a %23a %23a %23a : %23a %23a %23a %23a\n",i, c[3], df[i-1],df[i],df[i+1],df[i+2],f[i-1],f[i],f[i+1],f[i+2]); which constructs numerical tables. note that: %a prints p

c# - Is it possible to execute custom code every time Thread.MemoryBarrier() gets called? -

using instrumentation tools cecil perhaps? guess if it's possible, mean i'd have bundle instrumented versions of standard .net libs? also, correct in assuming thread.memorybarrier() called .net code generates full fence? no answer, guess answer no.

android - when to call view's GetParent method, how is view's life-cycle -

when call view's getparent method in constructor, returns null. should call method view`s parent. thanks it returns null because in constructor view doesn't have parent yet. gets parent when add view view doing addview(yourview); short example: linearlayout layout = new linearlayout(context); yourview yourview = new yourview(context); // yourview constructor gets called layout.addview(yourview); // parent gets set layout

.net - Silverlight localization - how to override windows culture -

i got english windows version , can't debug localizing application 2 languages russsian , english. from understand following code should enough in app constructor: if (language == language.russian) { thread.currentthread.currentculture = russian_culture; thread.currentthread.currentuiculture = russian_culture; } else { thread.currentthread.currentculture = english_culture; thread.currentthread.currentuiculture = english_culture; } cultures objects correct cultures (ru-ru , en-us). however when application ran on russian windows if ignored, , russian strings used. notice language change works correct on machine (en windows) i read in "clr via c#" book jeff richter: (about currentuiculture) by default, when create thread, thread property set culterinfo object, identifies language of windows version application running on using win

java - Bad Performance for Dedupe of 2 million records using mapreduce on Appengine -

i have 2 million records have 4 string fields each needs checked duplicates. more specific have name, phone, address , fathername fields , must check dedupe using these fields rest of data. resulting unique records need noted db. i have been able implement mapreduce, iterarate of records. task rate set 100/s , bucket-size 100. billing enabled. currently, working, performance very slow. have been able complete 1000 records dedupe processing among test dataset of 10,000 records in 6 hours. the current design in java is: in every map iteration, compare current record previous record previous record single record in db acts global variable overwrite previous record in each map iteration comparison done using algorithm , result written new entity db at end of 1 mapreduce job, programatically create job the previous record variable helps job compare next candidate record rest of data i ready increase amount of gae resources achieve in shortest time. my questions are:

hudson - Any way to get around cloning a git submodule? -

i work on open source project. keep our production config files in separate git repository available few members of our team. repo submodule of our larger project , allows people grab , compile project without seeing our prod creds. the problem hudson tries pull down submodule , hudson user doesn't have pull permissions on repo. hudson.plugins.git.gitexception: error performing command: git submodule update command "git submodule update" returned status code 1: initialized empty git repository in <http://athenadev.fracturedatlas.org:5904/job/athena/ws/assembly/.git/> error: permission fracturedatlas/assembly.git denied fracturedatlas/artful.ly. fatal: remote end hung unexpectedly clone of 'git@github.com:fracturedatlas/assembly.git' submodule path 'assembly' failed @ hudson.plugins.git.gitapi.launchcommandin(gitapi.java:691) is there "git" way around or going need re-think our strategy keeping production credentials awa

c++ - Automatic Copy of Dependent Files in Qt Creator -

i've build program using qt creator 2.2.1 , qt 4.7.4 (32 bit) output executable. opening exe using dependencywalker shows exe uses following dlls: kernel32.dll msvcrt.dll mingwm10.dll libgcc_s_dw2-1.dll qtcore4.dll qtgui4.dll i want after build dependent files (which may different in other project) except windows specific files (the first 2 in above list) automatically copied in directory exe located. how can in qt creator or qt system without using command line scripting? thanks. in qt 5.3, may able use windeployqt qt tool automatically copy needed libraries. the following additions project's .pro file should trick, might have make adjustments based on particular situation. isempty(target_ext) { win32 { target_custom_ext = .exe } macx { target_custom_ext = .app } } else { target_custom_ext = $${target_ext} } win32 { deploy_command = windeployqt } macx { deploy_command = macdeployqt } config( debug, d

development environment - php dev/testing servers -

i need simple "development" server php, e.g. not apache. in modern environment, such node.js, can run node server.js inside folder, , run server running site specified server.js . can run node process different folder, , 2 servers never interfere or in each other's way. is there similar setup php? with apache, seems me need "configure" server ahead of time; can't drop folder , serve content on arbitrary port. i want command can use run php server inside folder, minimum amount of configuration, purpose of being development/testing server. for instance, suppose server called sps , then, should able to: cd ~/code/proj1 sps perhaps require simple config file, sps.conf specifies port number server should listen to, plus maybe information database connection; nothing more. does such tool exist php? with current version of php (< 5.4) , indeed have configure webserver (apache, nginx, ...) serve directory in you'll have websit

internet explorer - What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do? -

what's difference if 1 web page starts with <!doctype html> <html> <head> <meta http-equiv="x-ua-compatible" content="ie=edge"> and if page starts with <!doctype html> <html> <head> <!-- without x-ua-compatible meta --> if there no difference, suppose can ignore x-ua-compatible meta header, since want rendered in standard mode in ie versions. october 2015 update this answer posted several years ago , question should should consider using x-ua-compatible tag on site changes microsoft has made browsers (more on below). depending upon microsoft browsers support may not need continue using x-ua-compatible tag. if need support ie 9 or ie 8, recommend using tag. if support latest browsers (ie 11 and/or edge) consider dropping tag altogether. additional info below: the x-ua-compatible meta tag allows web authors choose version of internet explorer page should rendered as

Can we add comments or a README file to a SQL Server database/table? -

these days importing quite lot of databases server , working on them locally. in process, making number of changes table structure , in process using complex sql statements add table columns. keeping track of in separate file beginning pain , wondering if there way directly in ssms can store instructions along database. there way can done or have resort writing documentation outside sql server? of course, can create stub table called comments , put there looking way associate comments particular database or tables. suggestions appreciated. sql-server handles commenting on database objects through extended properties: http://msdn.microsoft.com/en-us/library/ms190243.aspx

c++ equivalent to python append method for lists -

i'm learning c++ coming background in python. i'm wondering there way append items list in c++? mylist = [] in range(10): mylist.append(i) is there in c++ can array? you need vector, this: #include <vector> void funct() { std::vector<int> mylist; for(int = 0; < 10; i++) mylist.push_back(10); } see http://cplusplus.com/reference/stl/vector/ more information.

msxml6 - MSXML 6, User/PW Auth, ResolveExternals -

if 1 must load , parse xml resource user/pw-protected url cannot use msxml dom.load() far can tell. there no place specify credentials. yet if use xmlhttprequest obtain , parse resource dom (via .responsexml property) have specify value .resolveexternals property. this more or less works out when use msxml 3, 4, (or 5) defaults true, in msxml 6 defaults false: resolveexternals property : in msxml 3.0, msxml 4.0, , msxml 5.0 default resolveexternals value true. in msxml 6.0, default setting false. if property set false, no external includes , imports resolved. is there way around not seeing? need externals resolved, when dealing xsds or wsdls. or fooling myself, , perhaps .resolveexternals never applies when using xmlhttprequest (only dom.load() calls)? have tried this? xmlhttp.responsexml.resolveexternals = true; xmlhttp.responsexml.setproperty("prohibitdtd", false); the thing solution may work msxml xmlhttp activex object. edi

select - jQuery: Selecting a link one level up from a lower level link -

i'm working unordered list of links has 2 levels: <ul class="level-1"> <li class="item-a"><a href="#">a</a></li> <li class="item-b"><a href="#">b</a> <ul class="level-2"> <li class="item-1"><a href="#">1</a></li> <li class="item-2"><a href="#">2</a></li> <li class="item-3"><a href="#">3</a></li> </ul> </li> <li class="item-c"><a href="#">c</a></li> </ul> i click 1 of .level-2 links, , want select higher level link list contains clicked link. (for example, click either 1, 2, or 3 - , want select b.) if clicked link selected $(this).find('a') -- how can select higher level link? would

memcheck - What does possible lost means in valgrind -

i have lot of possible lost entry valgrind. mean ? using sqlite , tested. don't think these correct entry. doing wrong ? 16 bytes in 1 blocks possibly lost in loss record 30 of 844 ==23027== @ 0x4a05e1c: malloc (vg_replace_malloc.c:195) ==23027== 0x6525be: sqlite3memmalloc (in app_mem.out) ==23027== 0x63c579: mallocwithalarm (in app_mem.out) ==23027== 0x63c904: sqlite3dbmallocraw (in app_mem.out) ==23027== 0x6886d6: codeoneloopstart (in app_mem.out) ==23027== 0x68a9c8: sqlite3wherebegin (in app_mem.out) ==23027== 0x68cc9e: sqlite3select (in app_mem.out) ==23027== 0x6a8644: yy_reduce (in app_mem.out) ==23027== 0x6aaeac: sqlite3parser (in app_mem.out) ==23027== 0x6ab357: sqlite3runparser (in app_mem.out) ==23027== 0x6adf84: sqlite3prepare (in app_mem.out) ==23027== 0x6ae82b: sqlite3lockandprepare (in app_mem.out) i had same curiosity after using sqlite valgrind , came bug entry indica

android - Suggestion Webservices -

hello friends, i want load image , .swf file , video(flv,mp4) in android. want make webservices in vb.net , make database. so data-type suggest .net each entity? at android side, sax-parser comfortable? load huge amount of data there memory problem raise ? precaution fetch entity. thanks nik

perl - Unicode::Normalize - query about the 'Normalization From' -

#!/usr/local/bin/perl use warnings; use 5.014; use unicode::normalize qw(nfd nfc compose); $string1 = "\x{f5}"; $nfd_string1 = nfd( $string1 ); # pv = 0x831150 "o\314\203"\0 [utf8 "o\x{303}"] * $composed_nfd_string1 = compose( $nfd_string1 ); # pv = 0x77bc40 "\303\265"\0 [utf8 "\x{f5}"] * $nfc_string1 = nfc( $string1 ); # pv = 0x836e30 "\303\265"\0 [utf8 "\x{f5}"] * $string2 = "o\x{303}"; $nfd_string2 = nfd( $string2 ); # pv = 0x780da0 "o\314\203"\0 [utf8 "o\x{303}"] * $composed_nfd_string2 = compose( $nfd_string2 ); # pv = 0x782dc0 "\303\265"\0 [utf8 "\x{f5}"] * $nfc_string2 = nfc( $string2 ); # pv = 0x7acba0 "\303\265"\0 [utf8 "\x{f5}"] * # * devel::peek::dump output 'ok' if $nfd_string1 eq $nfd_string2; 'ok' if $nfc_string1 eq $nfc_string2; output: ok ok after trying asked me: there reason

Problem with WCF Hosting on Mono -

i trying host simple application 1 .aspx, .asmx , .svc file each. followed below guide achieve hosting (since new linux world, took while understand it!): http://www.mono-project.com/mod_mono#manual_mod_mono_configuration after hosting, able access aspx , asmx file. when try access svc file, below error: the servicehost must have @ least 1 application endpoint (that not include metadata exchange endpoint) defined either configuration, behaviors or call addserviceendpoint methods. or httplistenercontext not match of registered channels i have pretty straight forward service endpoint defined in web.config looks below: <system.servicemodel> <services> <service name="testwcfservice"> <endpoint address="http://localhost/monotest/testwcfservice.svc" binding="basichttpbinding" contract="monotest.itestwcfservice"></endpoint> </service> </services> <behaviors> <

multithreading - Android - How do I find what is causing StringIndexOutOfBoundsException -

i have app opens webview and, in different thread (asynctask), periodically submits gps data on http server. i seeing following exception having difficult time pinpointing source. can help? relative newbie android here. v/ exception handler( 206): java.lang.stringindexoutofboundsexception v/ exception handler( 206): v/ exception handler( 206): --------- stack trace --------- v/ exception handler( 206): v/ exception handler( 206): java.lang.string.<init>(string.java:190) v/ exception handler( 206): android.webkit.frameloader.populatestaticheaders(frameloader.java:372) v/ exception handler( 206): android.webkit.frameloader.handlehttpload(frameloader.java:222) v/ exception handler( 206): android.webkit.webviewworker.handlemessage(webviewworker.java:129) v/ exception handler( 206): android.os.handler.dispatchmessage(handler.java:99) v/ exception handler( 206): android.os.looper.loop(looper.java:130) v/ exception handler( 206):

powerbuilder - Get objects of DataWindow band -

how can array of objects in specific band, detail or header example? i success objects using: dw_1.describe("datawindow.objects") you need datawindow.visualobjects property lists visible objects , each object, ask object_name.band check if want it. an example reuses pbniregex (that provides uo_regex object in code below) simplify properties parsing : public function long of_get_band_controls (string as_band_name, ref string as_controls[]); string ls_empty[] int i, j as_controls[] = ls_empty[] uo_regex lnv_regex lnv_regex = create uo_regex lnv_regex.initialize( "([^\t]+)", true, false) = lnv_regex.search( describe("datawindow.visualobjects") ) j = 1 if describe( lnv_regex.match( j ) + ".band" ) = as_band_name as_controls[ upperbound(as_controls[])+1 ] = lnv_regex.match( j ) end if next destroy lnv_regex return upperbound( as_controls[] ) end function that code comes datawindow herited object, hence get

python - How to name class instances after an iterable keys? -

i'd create instances of classes getting names list values or dictionaries keys or values. i'd is: iter = ['foo', 'bar'] in iter: = cls() and foo , bar instances of cls() class instead of having instance referenced updated @ each loop. thanks in advance. maybe dictionnary : iter = ['foo', 'bar'] result = {} in iter: result[a] = cls() and in result you'll have { 'foo' : instance_of_cls, 'bar' : instance_of_cls}

c# - having trouble uploading datatable to SqlServer 2008 from Winforms application -

i'm streaming data csv file , trying import sql server 2008. i've looked around on web , i've come approach , not working. ideas on how make better (in sense works). the input parameter csv data in datatable. here's code: private void exportcsv(datatable dtcsv) { datetime dayofyear = datetime.now.date; dtcsv.tablename = "activationdate_"+dayofyear.tostring(); string createtemptable = "select * thisactivation @tvp"; using (sqldataadapter adap = new sqldataadapter(createtemptable,getconnection())) { adap.insertcommand.parameters.add("@tvp", sqldbtype.nvarchar, int.maxvalue); adap.insertcommand.parameters["@tvp"].value = dtcsv; adap.insertcommand.executenonquery(); } } you can't parameterize table names (or column names, matter). one option revert dynamic sql , though opens sql injection . this work, though shoul

objective c - Crash upon getting data from NSUserDefaults -

getting data nsuserdefaults , passing has parameter application crashed nsuserdefaults *prefs = [nsuserdefaults standarduserdefaults]; [logincontroller showview:[prefs objectforkey:ksavedusername] :[prefs objectforkey:ksaveduserpassword]]; // [logincontroller showview:@"abcd03@gmail.com" password:@"apple”]; when printing value in nslog [prefs objectforkey:ksaveduserpassword] showing value. password , [prefs objectforkey:ksavedusername] user name. if hard-coded requirement parameters working fine. my crash log is unrecognized selector sent instance 0x5ccc2d0 2011-07-21 14:32:27.721 ishop[3815:207] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[loginviewcontroller showview::]: unrecognized selector sent instance 0x5ccc2d0' *** call stack @ first throw: your logincontroller doesn't respond showview:: message, that's why app crashes. check method name in loginviewcont

How do I change the start site in liferay? -

i need change title of start page (e.g. "liferay"). need delete 7cogs inc pages "go to" menu. , there portlet letting users register @ portal? all administrative tasks can handled in control panel. for deleting sites can use sites panel. find site wish delete , hit "action" "delete". though renaming landing site bit different, you'll have head on "portal settings" panel , change name. i suggest beginning clean database , remove of bundled plugins in tomcat/webapps/. typically, remove folders except root (required liferay) , tunnel-web (required web services). doing allow start clean liferay without default 7cog content.

asp.net mvc - Exporting from MVC View to CSV (for Excel) -

this strange one, have working in controller code below filestreamresult comes in file has 84 of 100 results. variable searchresults contains 100 records. if step through controller code @ runtime "sw.writeline(........." line inside loop executes 100 times expected. so appears data being sent filestream being truncated. after debugging i've no idea why happening since 100 records contain no nulls or odd data meta-characters or that. ever seen odd behaviour before or have ideas on this? my controller code : public filestreamresult export(string searchtext, string searchtextsite, string startdate, string enddate) { var searchresults = getsearchresults(searchtext, searchtextsite, startdate, enddate); httpcontext.response.addheader("content-disposition", "attachment; filename=export.csv"); var sw = new streamwriter(new memorystream()); sw.writeline("\"ref\",\"source\",\"

osx - Renewed codesign certificate shows keychain authorization dialog -

my app stores items in mac's keychain. made sure signed app using code signing certificate users aren't bothered keychain authorization dialogs everytime update app. the problem is: code sign certificate valid 1 year , had renew certificate recently. want release new update signed using renewed certificate. when install update, keychain no longer trusts app , shows authorization dialog. is there way avoid this? if not, there can avoid next time cert expires? i couldn't find way avoid this. ca generates new cert when renewing old certificates. 'solution' apply longer code signing certificate - 3 years.

javascript - Start upload after choosing a file, using jQuery. -

after having chosen file upload, want file uploaded database without click of button. how done using jquery? i choose file this: http://i.stack.imgur.com/0408t.gif <input type="file" valign="baseline" /> assuming you're using form: // select file input (using id faster) $('input[type=file]').change(function() { // select form , submit $('form').submit(); }); edit: to keep answer up-to-date: there nice way upload files via ajax without hacks described here: http://net.tutsplus.com/tutorials/javascript-ajax/uploading-files-with-ajax/

iis 7 - How to redirect in IIS7 for this url format -

i wonder how specific redirection based on scenario below? when people open url @ browser http://www.test.com/gotogoogle redirect them http://www.google.com . you can achieve url rewrite module. rule (content of web.config website root folder): <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <rewrite> <rules> <rule name="go google" stopprocessing="true"> <match url="^gotogoogle$" /> <action type="redirect" url="http://www.google.com/" /> </rule> </rules> </rewrite> </system.webserver> </configuration> if have web,config, add appropriate fragment only.

encryption - MD5 security is fine? -

im new @ coding maybe i've missed point of md5 about. what' i've experienced md5 encryption "static" each word. static mean find same result example md5("hello"). , makes me think is highly reversible using library. what if md5("hello") assigned number (example 5), , string example xbuidsjsdsjsd44s64sd encryption. , equal 5 if sfoiefef465f4ze4f6fe encryption. , equal 5 because both mathematical calculation ends same result. dynamic encryption? i think, tell i'm newb @ this, questions bother me, think people have access database md5's password, can reverse them testing words , stocking them library. what think guys? , there alternative md5? thank or enlightnment these indeed legitimate concerns. might find following articles interesting: rainbow table salt but md5 considered "broken" security professionals. depends on exactly requirements are: md5 might suitable, more secure hashes sha-2 family

java - MVEL nested property resolution issue -

i have following class private static class person{ private int iq; private person[] minions; public int getiq() { return iq; } public person[] getminions() { return minions; } } i'm trying out following mvel (1.3.16-java1.6) expression against code count = 0; foreach (minion : minions){ if (minions[count].iq > 120) { return true; } } return false; however mvel seems have problems minions[count].iq (or minions[0].iq ) construct. any inputs appreciated. compilers exact grouse is caused by: java.lang.illegalaccessexception: class org.mvel.optimizers.impl.asm.asmaccessoroptimizer can not access member of class person modifiers "public" your person class private, assume not visible asmaccessoroptimizer or if would, asmaccessoroptimizer not have rights access it. declaring person public should solve issue.

version control - Git hub: I added a file but I want to exclude it from my next commit -

i new git hub, added file mistake dont want there next time commit.. how view files committed next time? , how exclude files? and in general, recommendations tutorials using git hub , commands (their official tutorials horrible)? or user friendly gui? have been using cvs , svn 3 years , i've never suffered version control system before!! if unstage file, e.g. revert before did the $ git add not_commit.file simple remove staging area with $ git rm --cached not_commit.file

c# - Is using ObjectDataSource a good practice? -

in company few of employees using objectdatasource. example snippet : <asp:objectdatasource id="odsrequirement" runat="server" enablepaging="true" maximumrowsparametername="intmaxrows" selectmethod="getall" startrowindexparametername="introwindex" typename="mynamespace.mytype" sortparametername="sortstring" onselecting="odsrequirement_selecting" selectcountmethod="getallcount"> <selectparameters> <asp:parameter name="a" defaultvalue="null" /> <asp:parameter name="b" defaultvalue="null" /> <asp:parameter name="c" /> <asp:parameter name="d" /> <asp:parameter name="e" /> &

iphone - how to dismiss action sheet with a custom button -

i created 2 buttons , 1 date picker on action sheet.on clicking done button want dismiss action sheet.can please code dismissing action sheet. i'm using code giving action done button: [donebutton addtarget:self action:@selector(dismissactionsheet:) forcontrolevents:uicontroleventvaluechanged]; in dismissactionsheet method write [asheet dismisswithclickedbuttonindex:0 animated:yes];

iphone - Inheritance in Objective C -

i have main game class renders game using open gl. thought inherit class , call [super init] in init method copy of it. plan make modifications in copy seems doesn't work. the following header file of class: #import "gameview.h" @interface cloneview : gameview { } -(id)initwithframe:(cgrect)frame; @end and clone view class: @implementation cloneview -(id)initwithframe:(cgrect)frame{ return [super initwithframe:frame]; } @end if set break point in init method in gameview class stops there. thing is: clone view doesn't rendered, screen stays black. missing? help! edit record: tried without implementing initframe , got same result. (as expected initframe above isn't doing apart calling super) edit 2 i'm adding clone view i'm creating 2 eagle contexts. reason why doesn't work? if not adding in init function of cloneview don't have rewrite it. can have class inherit gameview , automatically copies it's

java - Why does my applet flash for every repaint? -

i found java game code online , trying modify it. converted jframe applet, game started blink every time repaint screen. tried double buffering no difference. source: private void paintdisks(graphics g) { try { (disk d : disk) paintdisk(g, d); } catch (exception ex) { //system.out.println(ex.getmessage()); paintdisks(g); // retry disks never not painted } } private void paintdisk(graphics g, disk d) { if (d == null) return; if (diskimg[d.player] == null) { g.setcolor(colour[d.player]); g.filloval((int)d.x - 1, (int)d.y - 1, 32, 32); } else { g.drawimage(diskimg[d.player], (int)d.x - 1, (int)d.y - 1, 32, 32, this); } } @override public void paint(graphics g) { // paint real panel stuff super.paint(g); graphics gr; if (o

python - Django-guardian on DB with shared (non-exclusive) access -

i developing django app being web frontend oracle database local db keeping app's data such guardian permissions. problem can modified different places don't have control of. let's have 3 models: user , thesis , userthesis . userthesis - table specifying relationship between thesis , user ( user being co-author of thesis ) scenario: user removed author of thesis removing entry in userthesis table other app. user tries modify thesis using our django app. , succeeds, because guardian , django not know change in userthesis . i thought solutions: having cron job changes in userthesis checking modification date of entry. easy check additions, removals require looking on relationships again. modifying oracle db schema add guardian db tables , creating triggers on userthesis table. wouldn't this, because of oracle db being shared among number of different apps. manually checking relationship in views , templates (heavier load on oracle). wh

mysql - Select related Elements Attributes as String -

i have items table , tags table. have 1 select gets items under condition , each item selects related tags , puts them in string become seperate field. example: table_items: id | title --------------------------- 01 | peter --------------------------- 02 | john --------------------------- 03 | cindy tags: id | title --------------------------- 01 | tall --------------------------- 02 | tiny --------------------------- 03 | blone --------------------------- 04 | loud --------------------------- 05 | ... tags_to_items: itemid | tagid --------------------------- 01 | 02 --------------------------- 01 | 04 --------------------------- 02 | 01 ... i think point. now want result this: itemid | title | tags --------------------------- 01 | peter | tiny, loud --------------------------- 01 | john | tall, fast, bored can mysql? how? in mysql, need group_concat function that. something like: select ti.id, ti.title, group

Tool to Analyze SQL Server performance -

is there 3rd party tool works layer on top of sql server, can analyze behaviour of database , make recommendations based on that? thanks qure dbsophic great job @ describe. can bundle our tools (for more cost effective offering), sql sentry event manager , performance advisor, provide general around clock performance monitoring , alerting (these tools use dbas, , don't provide automatic optimizations way qure can). http://www.dbsophic.com/ http://www.sqlsentry.net/ http://sqlblog.com/blogs/aaron_bertrand/archive/2011/04/21/using-qure-workload-optimizer-for-sql-sentry.aspx

javascript - Removing unwanted keys from my array of objects -

my object how remove keys userid, username it... mean selected keys... delete operator not working in case. for (i=0 <obj.length; ++) { delete obj[i]['keyname']; } the above not work, neither throws error. other way... how solution.... array.prototype.containsvalue = function (value) { (var k in this) { if (!this.hasownproperty(k)) { continue; } //skip inherited properties if (this[k] == value) { return true; } } return false; }; (var key in object) { var unwantedkeys = ['username', 'userid']; if (unwantedkeys.containsvalue(key)) continue; // play object won't contain these unwanted keys. } delete should work, not sure mistake doing.. http://jsfiddle.net/spechackers/43htd/