Posts

Showing posts from September, 2013

database - Can I edit access backend file while others are using it? -

how can edit backend file of access database while others using it? understanding has been can't, wanted confirm before commit lot of late nights. , in regards "how can edit it", mean tasks such adding fields tables, deleting them, adding new tables etc. also, how compare working sql server backend? if it's not apparent, database split, , have low number of users (1-2) on @ time. i'm using access 2007 thanks in advance. i not edit live back-end, however, can make most, or possibly all, of changes on empty copy , append live data various tables little sql , vba.

actionscript 3 - as3 self preloaded (internal) in Document Class -

Image
i've googled lot , couldn't find except timeline based pre loaders or external pre loaders (loading external swfs). i'm looking document class preloaded has library symbols exported first frame. please advise. i have private variables inside document class referring exported clips. public var menu:menu; public var brand:movieclip; public var container:movieclip; public var background:background; public var intro:intro; public var language:language; plus lots of clips exported flash on frame 1, instance combobox, (screenshot below) you need use root.loaderinfo 's bytestotal , bytesloaded properties. when equal eachother, you've loaded 100% of swf , can manage should happen next accordingly. sample: package { import flash.display.sprite; import flash.events.event; /** * document class. */ public class document extends sprite { // constructor. public function document() { ...

binaryfiles - Read Binary file records in php -

i have created binary file using c codings. structure of binary file. struct emp { int eid,eage; char name[20],city[20]; }record; using 'c' structure created binary file called "table1.txt" now want show contents of file in web page using php. how can ? <html> <head> <title>binary file</title></head> <body style="background-color:yellow"> <? $fp = fopen("table1.txt", "rb"); $read = fread($fp, 4); $n = unpack("i", $read); $data1 = fread($fp, 8); $nn = unpack("i",$data1); echo $number[1]; ?> </body> </html> i have used above code. can read first field of file only. first record field employee id values '0'. page displays 0. for strange reason, each data segment not 48 bytes expected 52 bytes. $f = fopen('data.txt', 'rb'); while (!feof($f)) { // read 1 segment of 52 bytes if ($s = fread($f, 52)) { // unp...

android - Getting Error java.lang.IllegalStateException: get field slot from row 0 col -1 failed -

Image
helper class: package com.deangrobler.myapp; import java.io.fileoutputstream; import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import android.content.context; import android.database.cursor; import android.database.sqlexception; import android.database.sqlite.*; public class databasehelper extends sqliteopenhelper{ //the android's default system path of application database. private static string db_path = "/data/data/com.deangrobler.chumperoo/databases/"; private static string db_name = "chumperoodb.db"; private sqlitedatabase mydatabase; private final context mycontext; /** * constructor * takes , keeps reference of passed context in order access application assets , resources. * @param context */ public databasehelper(context context) { super(context, db_name, null, 1); this.mycontext = context; } /** * creates empty database on system , rewrites own database. * */ public void createdatab...

php - Getting reference to array element where array is accessible as $obj->$propName -

suppose have code (simplified example): $propertyname = 'items'; $foo = new \stdclass; $foo->$propertyname = array(42); at point 'd write expression evaluates reference value inside array. is possible this? if so, how? an answer "do job" not 'm looking this: // not acceptable: 2 statements $temp = &$foo->$propertyname; $temp = &$temp[0]; but why write 2 statements? well, because not work: // not work: php's fantastic grammar strikes again // equivalent $temp = &$foo->i $temp = &$foo->$propertyname[0]; of course &$foo->items[0] unacceptable solution because fixes property name. in case wondering strange requirements: 'm doing inside loop $foo reference node inside graph. solution involving $temp require unset($temp) afterwards setting $temp on next iteration not mess graph; unset requirement can overlooked if not ultra careful around references, wondering if there way write code such there ...

android - How to use Hashmap with Adapter -

hello parsing json on android , have been able put json parsed data listview. on listview, have icons set status according parsed data ( have keys define status, 1 enabled , 0 disabled). can't seem put on hashmap, has tip/information? thanks hashmap<string,boolean> map = new hashmap<string,boolean>(); collection c = map.values(); iterator itr = c.iterator(); while(itr.hasnext()) system.out.println(itr.next()); }

mysql - Test Remote Database Access Host -

i've set remote database access host , on web hosting cpanel, enabling home computer ip address access online database. to best of knowledge should working, i'm not 100% sure. is there quick way can connect database command prompt make sure allowing access ip address? use mysql client, if have installed it's quite easy access remote host mysql -hyour_ddbb_server_ip -uyour_user -pyour_password your_database_name or mysql -h your_ddbb_server_ip -u your_user -p your_database_name * note in first option there no blank spaces between parameter option , value * your_database_name optional

php - mod_rewrite dot in url -

i have problem in mod_rewrite code rewriterule ^test-(.*)-(.*)$ s.php?$1 [r,l] the url work fine link without dot like test-1-something but error found if url test-1-something.html please how can fix thank's edit: error 404 not found

random - Questions about set.seed() in R -

i understand set.seed() , when might use it, still have many questions function. here few: is possible "reset" set.seed() "more random" if have called set.seed() earlier in session? necessary? is possible view seed r using? is there way make set.seed() allow alphanumeric seeds, way 1 can enter them @ random.org (be sure in advanced mode, , see "part 3" of form see mean)? just fun: set.seed.alpha <- function(x) { require("digest") hexval <- paste0("0x",digest(x,"crc32")) intval <- type.convert(hexval) %% .machine$integer.max set.seed(intval) } so can do: set.seed.alpha("hello world") (in fact x can r object, not alphanumeric string)

entity framework - The ConnectionString property has not been initialized -

i using entity framework make 2 queries, 1 after another, first 1 works fine, second 1 returns me: connectionstring property has not been initialized. if change order of methods, same thing happen, first 1 works fine, second 1 throws exception. the code use in page follows: > var count = requestbasebl.getgenericresultscount(query.querysql); > > var datatable = requestbasebl.getgenericresults(query.querysql, 0); and in dal public int getgenericresultscount(string strsql) { using (var connection = (sqlconnection)_context.database.connection) { var adapter = new sqldataadapter(strsql, connection); var results = new dataset(); adapter.fill(results, "results"); return results.tables["results"].rows.count; } } public datatable getgenericresults(string strsql, int ...

java - How to add some contents in pom.xml for "mvn install"? -

i have multiple java projects me. have 1 document build source code using maven. following , trying build project. 1) in document given have "mvn install" or "mvn -dmaven.test.skip=true install" @ root directory of project. 2) given if above steps generate error have add lines pom.xml file. lines are: add following entry last entry in list (you find entry id openxds new entry should follow one): <repository> <id>sysnetint</id> <url>http://sysnetintrepo.com/repository</url> </repository> you need add repository plugin repositories section: <pluginrepositories> <repository> <id>sysnetint</id> <url>http://sysnetintrepo.com/repository</url> </repository> </pluginrepositories> the build should successful @ point , should have targets ready deployment. i add first lines in respective node not getting add second lines in pom.xml because...

tomcat - Different dependency scope for webapp and standalone java app -

i'm using maven build java web application run in tomcat. jar files (e.g. mail-1.4.1.jar , database drivers) have been put in tomcat/lib directory , maven dependency set "provided". (i'm not 100% sure why, think it's jndi.) now have built standalone executable java program in same maven project trying execute using mvn exec:java . unsurprisingly can't find mail.jar , error java.lang.noclassdeffounderror: javax/mail/session how specify javax.mail scope="runtime" standalone java program whilst still being "provided" tomcat app? have use maven profiles? if so, can find useful documentation on how works (are profile's dependencies additive or overwrite default ones etc?) the raghuram answer correct, want point out something. as sonatype wrote in blog : http://www.sonatype.com/people/2010/01/how-to-create-two-jars-from-one-project-and-why-you-shouldnt/ i want clear answer. recommend not configure maven project creat...

generics - What does this Java syntax mean? (`Class<? extends ContactAccessor> clazz`) -

i have been developing android applications 1 month getting pretty familiar java syntax today stumbled upon piece of code : try { class<? extends contactaccessor> clazz = class.forname(classname).assubclass(contactaccessor.class); sinstance = clazz.newinstance(); } catch (exception e) { throw new illegalstateexception(e); } could explain me class<? extends contactaccessor> clazz does? it means have class contactaccessor class or sub class of class or interface. since have contactaccessor.class already, assume have sub class.

iReport multiple copies of same report with different label -

i using ireport 4.1.3 . have created invoice report , want have 3 copies of same invoice report. first invoice should have label "original", second should have "duplicate" , third should have label "triplicate" on it. thank you. if show 3 copies every time open report, here creative if not elegant solution. add cross join clause of query returning 3 different copies. in mysql looks this: cross join ( select 'original' copy, 1 sequence union select 'duplicate' copy, 2 sequence union select 'triplicate' copy, 3 sequence ) x then add "copy" field select statement. cause query return 3 records each record returning. 1 record "original" in copy field, 1 "duplicate" , 1 "triplicate". add "sequence" order clause. then in report, group "copy" field. force new page each group , should set. variables totaling @ report level need change group level ("...

java - Custom design for Close/Minimize buttons on JFrame -

Image
i apply own close , minimize buttons. there way change jframe design? the trick lies in plaf , setdefaultlookandfeeldecorated(true) ( specifying window decorations ). e.g. import java.awt.borderlayout; import javax.swing.*; public class frameclosebuttonsbylookandfeel { frameclosebuttonsbylookandfeel() { string[] names = { uimanager.getsystemlookandfeelclassname(), uimanager.getcrossplatformlookandfeelclassname() }; (string name : names) { try { uimanager.setlookandfeel(name); } catch (exception e) { e.printstacktrace(); } // important window decorations. jframe.setdefaultlookandfeeldecorated(true); jframe f = new jframe(uimanager.getlookandfeel().getname()); f.setdefaultcloseoperation(jframe.dispose_on_close); jpanel gui = new jpanel(new borderlayout()); f.setc...

json - Rails 3.2.2 - Possible to add custom node to as_json -

as it's not possible me use json templating engine (jbuilder or rabl) per rails3 actionview template handlers doesn't work on production server i'm wondering how best change controller action include custom node as_json (or else) class mobile::androiduserscontroller < securemobileusercontroller skip_before_filter :authorize, :only => :create respond_to :json # post /mobile_users # post /mobile_users.xml def create @mobile_user = androiduser.find_by_auth(params[:mobile_user][:auth]) unless @mobile_user @mobile_user = androiduser.new(params[:mobile_user]) else @mobile_user.attributes = params[:mobile_user] end respond_to |format| if @mobile_user.save format.json #add custom token node here else :unprocessable_entity } format.json { render json: @mobile_user.errors, status: :unprocessable_entity } :unprocessable_entity } end end end end i need add custom node called token has va...

WCF service not returning JSONP which causes error in dojo app -

i have tried many demos , egs. , got advice here when having issues service requests. anyway using io.script.get data remote server , problem callback parameter either undefined or invalid label. function searchgoogle() { // node we'll stick text under. var targetnode = dojo.byid("rules"); var jsonpargs = { url: "http://localhost/wcfservices/wcfinstancerules2/service1.svc/retrievedata", callbackparamname: "callback", content: { screenname: "dpjo" }, load: function (data) { // set data search viewbox in nicely formatted json targetnode.innerhtml = "<pre>" + dojo.tojson(data, true) + "</pre>"; }, error: function (error) { targetnode.innerhtml = "an unexpected error occurred: " + error; } }; dojo.io.script.get(jsonpargs); } dojo.ready(searchgoogle); i see json response in fidd...

Maven - Skip reporting on specific modules -

i looking solution skip maven reporting on modules not critical final product. such modules unit tests only, or third party plug-in log4j. i have parent pom, in modules defined. <project> <modules> <module>module1</module> <module>module2</module> <module>module3</module> <module>module4</module> </modules> </project> there dependencies , profiles. please keep in mind, project builds. im looking reduce time mvn package site complete (currently on 30min) stepping module1 there parent info, artifact id, , packaging (pom). more sub-modules defined <modules> <module>package1</module> <module>package2</module> <module>package1.tests</module> </modules> it package1.test want skip reporting on. most of can find revolves around plugins such maven website: <build> <plugins> <plugin> <groupid>org...

android - How to Change String to a Double? -

i have created small program allows users enter numeric values edittext. when click button first time, app should display in textview after should save new value if greater previous value help me please. public class bidactivity extends activity implements onclicklistener { public textview tt; public edittext textbo; public string total; public button btnnn; public double protein; double price = 0; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); textbo = (edittext)findviewbyid(r.id.txtbid); tt = (textview)findviewbyid(r.id.textview1); btnnn = (button)findviewbyid(r.id.btnbit); btnnn.setonclicklistener(this); } @override public void onclick(view v) { // todo auto-generated method stub string total = textbo.gettext().tostring(); pri...

netbeans - Where to get Java.media package? -

i making java applet player. includes java.media package, , not getting it. searched on google download in vain. a piece of code here import javax.media.*; axisplayer mplayer; mplayer = new axisplayer(videowidth, videoheight, mfps,murl.openstream()); this want don't have javax.media package. so question : q : download java.media package , how install jcreator/netbeans remember, using jdk 1.6.0. thanks in anticipation helping me. java media api you looking java.media.*

string - Check file extension in Java -

i have import data excel file database , this, check extension of chosen file. this code: string filename = file.getname(); string extension = filename.substring(filename.lastindexof(".") + 1, filename.length()); string excel = "xls"; if (extension != excel) { joptionpane.showmessagedialog(null, "choose excel file!"); } else { string filepath = file.getabsolutepath(); joptionpane.showmessagedialog(null, filepath); string upload = uploadpodata.initialize(null, filepath); if (upload == "ok") { joptionpane.showmessagedialog(null, "upload successful!"); } } but get: choose excel file! i can't find wrong code, please help. following extension != excel should be !excel.equals(extension) or !excel.equalsignorecase(extension) see also string equals() versus ==

c# - How do I create a task to read data continuously from a TcpClient using tasks and async methods -

i trying read data continuously tcpclient. here code snippet. var task = task.factory.startnew(read); task.continuewith(ant => console.writeline("error: " + ant.exception.message), taskcontinuationoptions.onlyonfaulted); task.continuewith(ant => { log("log data"); }); void read() { task<int> readchunk = task<int>.factory.fromasync( _stream.beginread, _stream.endread, data, bytesread, data.length - bytesread, null, taskcreationoptions.attachedtoparent); readchunk.continuewith(rt => { bytesread = readchunk.result; }, taskcontinuationoptions.notonfaulted | taskcontinuationoptions.attachedtoparent); } this bit of code works fine, there maybe more data coming on stream, want go , read again. starting read task doesn't seem right. not familiar tasks parallel library. have written this: while (true) { bytesre...

jsp - Check if parameter exists in Expression Language -

this question has answer here: evaluate empty or null jstl c tags 8 answers <c:if test="${param.username}" > </c:if> how check if param.username exists?? use not empty check. <c:if test="${not empty param.username}" > </c:if> edit: if have parameter of form ?username (no value), safer use ${param.username ne null}

windows - Save Android project to run on PC (eclipse) -

Image
is possible convert or export android project eclipse run on pc without emulator (like .exe)? nope, that's not possible, since android uses dalvik vm wich inbuilt in every emulator. deploying , .apk file in emulator fastest , easiest way when having no device. the dalvik vm complete environment wich not included (or sth) on windows:

django - Does Tastypie have a helper function to generate API keys? -

what i'm trying whenever user requests api key--regardless of whether user generated 1 or not--the system generate entirely new key. i know whenever calling apikey.objects.create() generate api key user doesn't have 1 generated. however, if user does have one, trying call .create() method throws error. in case, figured best write own key generator. however, hoping maybe here might know of helper function allow me generate random api key, , let me save database manually myself. would might know of such helper function? or, can use tastypie's built-in command: python manage.py backfill_api_keys

c# - ASP.net Menu - How to change Pop out Image on Hover -

Image
i have pop out image setup in asp.net menu menu items have child drop down menu. problem want able have image change on hover , not sure if can through css or c#. menu item arrow image: aspx code: <asp:menu id="menu1" staticpopoutimageurl="~/sites/0/pagelayouts/images/horizontal_main_arrow.jpg" itemwrap="false" runat="server" orientation="horizontal"> <databindings> <asp:menuitembinding datamember="menuitem" textfield="title" navigateurlfield="url" /> </databindings> <staticmenustyle cssclass="topstaticmenustyle" /> <staticselectedstyle cssclass="topstaticselectedstyle" /> <staticmenuitemstyle cssclass="topstaticmenuitemstyle" /> <dynamichoverstyle cssclass="topdynamichoverstyle" /> <dynamicmenustyle cssclass="topdynamicmenustyle" /> <dynamicselectedstyle cssclass="topdynamicselecte...

sql - Displaying messsage in specific format in mysql php -

i have created messaging system users allow users send message another. for have created 2 tables. conversation(conversation_id,user_id1,user_id2) messages(message_id,conversation_id,sender_id,receiver_id,message,created_time) if users talking first time, conversation_id created user_id1(who initiate chat) , user_id2(to user_id1 sending message) messages table contain info related message. now want is, create message summary page logged in user can view conversation list between other users order created_time, group conversation_id. here table data: conversation_id | user_id1 | user_id2 1 100 103 2 101 103 3 103 102 message_id| conversation_id| sender_id| receiver_id| message | created_time 1 1 100 103 msg 2012-06-08 08:38:57 2 1 103 100 msg b 2012-06-08 08:39:40 3 2 ...

ruby on rails - Routing the URL using values from database? -

i have controller streams_controller , model streams . class streamscontroller < applicationcontroller def new @stream = stream.new end def create @stream = stream.new(params[:stream]) if @stream.save flash[:success] = "welcome!" redirect_to @stream else render 'new' end end def show @stream = stream.find(params[:id]) end end and class stream < activerecord::base attr_accessible :name, :email, :password, :password_confirmation before_save { |stream| stream.name = name.downcase } has_secure_password . . . basically work show method, have go localhost/streams/[id] [id] id of particular stream. possible reroute url go this: localhost/[name] [name] :name attribute of stream model? so new url created every time new stream created, , correspond name of stream in database. how go implementing this? anyways, or thoughts appreciated! i make streams part of url short...

android - How to startForeground() without showing notification? -

i want create service , make run in foreground. most example codes have notifications on it. don't want show notification. possible? can give me examples? there alternatives? my app service doing mediaplayer. how make system not kill service except app kill itself (like pausing or stopping music button). as security feature of android platform, cannot , under any circumstance, have foregrounded service without having notification. because foregrounded service consumes heavier amount of resources , subject different scheduling constraints (i.e., doesn't killed quickly) background services, , user needs know what's possibly eating battery. so, don't this. however, is possible have "fake" notification, i.e., can make transparent notification icon (iirc). extremely disingenuous users, , have no reason it, other killing battery , creating malware.

jquery - Hovering over item in WordPress list of pages shows Featured Image -

client requesting functionality allow wordpress generate list of child pages, , when item (text) list hovered, featured image show. here's example of such functionality. upon further research, found this thread . however, upon review seems though petley jones website has hardcoded page links. incorrect. needing wp_list_pages or perhaps get_page used since there many child pages added staff , not 1 person. i aware of solutions using both jquery , css. jquery solution seems best this, not sure how go coupling wordpress. css require each item have same class or id, can implement, not sure how call unique page ids within stylesheet. advice appreciated! you may try follow following procedure- when fetch child pages wrap div class name <div class="child_page"></div> , inside place child page's name's php code. inside div below child page's code add div class <div class="child_page_img"></div> , inside place co...

javascript - How to apply formatting to text in a textarea or an alternative to textarea that allows formatting? -

i'm making html5 game , have chatbox going right using textarea element in html5. it'd nice if selectively color/bold/italicize lines in chat. i looking around , i'm not sure if can done. first, can done natively using latest web technologies? if not, , simple alternatives textarea work on firefox/opera/safari/chrome , offer similar functionality textarea? thanks! you can create div , make content editable (here's demo http://html5demos.com/contenteditable ) <div contenteditable="true"> </div> you can via onkeyup javascript event color code things

mysql - Local Sql express 2 way sync to remote server -

i have native windows application (software) local sqlexpress database. need bring data every local install (5000 in number) central server mysql. 1./ don't think able port forwards etc on router @ every local installation , hence wonder what's best way synchronization done. 2./ @ central server should use ms sql instead. there compelling reason stick ms sql @ central level? regards ravz at central server should use ms sql instead yes, , not free version. you use sort of replication. is there compelling reason stick ms sql @ central level? you must joking. read documentation. sql server has nice features in non free versions - replication example. last time tried setting (laptops, ages ago) went transactional replication between sql servers , worked charm. alternatively can sit down , start writing. there db agnostic sync fraemwork available, or can totally roll own - both valid approaches. should check first can do. check http://msdn.micros...

c# - Can't insert values into a table, because of false database constraint -

i'm having problem. have oracle database setup 3 tables, first 1 project , second skill , third 1 requiredskill , link between first 2 tables. both primary keys in third table foreign key. at point in program, create project , save in database. directly after insert 2 values requiredskill table, primary key of skill table , primary key of created project. i insert data following code: oraclecommand cmd = new oraclecommand(); cmd.parameters.add(new oracleparameter("projid", project.projid)); foreach (skill skill in skills) { cmd.connection = conn; cmd.parameters.add(new oracleparameter("skillid", skill.skillid)); cmd.commandtext = "insert requiredskill values(:skillid, :projid)"; try { conn.open(); cmd.executenonquery(); } catch (oracleexception) { } { conn.close(); } } as execute the qu...

c++ - Why shared_ptr has an explicit constructor -

i wondering why shared_ptr doesn't have implicit constructor. fact doesn't alluded here: getting boost::shared_ptr this (i figured out reason thought fun question post anyway.) #include <boost/shared_ptr.hpp> #include <iostream> using namespace boost; using namespace std; void fun(shared_ptr<int> ptr) { cout << *ptr << endl; } int main() { int foo = 5; fun(&foo); return 0; } /* shared_ptr_test.cpp: in function `int main()': * shared_ptr_test.cpp:13: conversion `int*' non-scalar type ` * boost::shared_ptr<int>' requested */ in case, shared_ptr attempt free stack allocated int. wouldn't want that, explicit constructor there make think it.

python - Matplotlib subprocess/backend issue -

i want plot (i.e. write file) matplotlib script runs subprocess (launched python cgi-script apache server), somehow either plot isn't created or server crashes depending on backend use. think should using "agg", , plot created in case, server crashes (internal server error). here's log: ah01215: /usr/lib/pymodules/python2.7/gtk-2.0/gtk/__init__.py:57: gtkwarning: not open display, referer: http://localhost/ ah01215: warnings.warn(str(e), _gtk.warning), referer: http://localhost/ ah01215: /usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk.py:49: gtkwarning: ia__gdk_cursor_new_for_display: assertion `gdk_is_display (display)' failed, referer: http://localhost/ ah01215: cursors.move : gdk.cursor(gdk.fleur),, referer: http://localhost/ malformed header script 'submit.cgi': bad header: ['/home/user/..., referer: http://localhost/ the cgi-script doens't depend on output of subprocess @ moment, don't bad-header...

g++ - Entering the input values during run-time of a C++ program (./filename.out) -

i want enter user input during run-time of c++ program i.e during ./a.out illustration : ./a.out input1 input2 the c++ program : program add 2 numbers #include<iostream> using namespace std; int main() { int a, b; cin >> >> b; int c = + b; cout << "the sum of 2 numbers : " << c << "\n"; } now please me enter values of , b @ run-time while running output file in linux terminal. try (dont forget include appropriate headers) int main(int argc, char** argv) { if ( argc == 3 ) // command line has 3 arguments, program, arg1 , arg2 { int sum = atoi(argv[1]) + atoi(argv[2]); cout<<"the sum of 2 numbers : "<< sum << endl; } else { cout << "wrong number of arguments, expected 2 numbers" << endl; cout << "yourprogramname {number1} {number2}" << endl; } }

cocoa:how to use a web view property created in a class derived from NSViewController in an app delegate class? -

the code in app delegate class: - (void)webview:(webview *)webview decidepolicyfornewwindowaction:(nsdictionary *)actioninformation request:(nsurlrequest *)request newframename:(nsstring *)framename decisionlistener:(id < webpolicydecisionlistener >)listener{ nslog(@"hello"); nstabviewitem *newitem=[[nstabviewitem alloc] init]; nsinteger index = [_tabview numberoftabviewitems]; [_tabview inserttabviewitem:newitem atindex:index]; [newitem setlabel:@"empty tab" ]; //[_tabview selectprevioustabviewitem:@"select"]; newvc =[[newviewcontroller alloc] initwithnibname:@"newviewcontroller" bundle:nil]; [[_tabview .tabviewitems objectatindex:index] setview:[newvc view]]; newviewcontroller *obj=[newviewcontroller alloc]init]; [obj.newwebview mainframe]loadrequest:request]; } this code not loading web view requested url. here newwebview web view property have created in newviewcontroller class. first of all, trying do? newvi...

configuration - Asp.net mvc3 application display project directory content instead of main page in browser -

i've copied asp.net mvc3 application source development machine. want run application, when run application browser show me project directory content instead of application main page. suppose have mistakes in iis configuration, don't know incorrect. so, wrong? upd:i did found "use local iis web server" radiobutton in settings window checked (instead default "use visual studio development server"). Мay option affects? did configure folder in iis application? sounds me you've cloned folder , expect 'just work'. right-click on folder in iis , select 'convert application'. on dialog appears need change app pool 'asp .net v4'. once you've done should work.

Emacs DNS lookup -

i noticed, when network down, emacs starting lot slower. stracing it, shows how emacs trying resolve hostname :s anyone knows how disable this? why emacs needs hostname? also, i'm keeping .emacs minimal , double checked if of modules using dns or network queries. thanks. a similar issue discussed here .

active directory - PowerShell New-ADUser fails in cycle -

here powershell code adding test user accounts active directory... problem: when $i between 1 , 99, works fine... immediatelly after $i reaches 100, created accounts disabled , error message in console telling " the password not meet length, complexity, or history requirement of domain. " any idea what's problem? //edit: no password policy set domain thanks import-module activedirectory for($i=1; $i -le 500; $i++){ $name="name1_$i" #name $surname="surname1_$i" #surname $logon="logon1$i" #logon $plainpass='pas5w0rd'+$i+'&g' $password=convertto-securestring -asplaintext -force -string $plainpass new-aduser -enabled 1 -name $name -accountpassword $password -displayname "$name $surname" -givenname $name -userprincipalname $logon@testdomain.local -samaccountname $logon -surname $surname -path "ou=sometest,dc=testdomain,dc=local" } so reproduce problem, under default domain policy...

crystal reports - Cannot change datasource for a subreport: no data returned with the new datasource -

i have main report 3 sub reports connected sql database. attempting change report different odbc connection. used "set datasource location" update odbc. main report works fine, sub reports not return data. have saved sub reports separate report , tried run them. still not return data. if change odbc location original works fine. 2 databases identical. seems there within sub report not updating new database. main report hitting same tables sub reports , working. i running windows 7 , crystal xi. right-click on each sub-report , select "edit sub-report" , there change data-source location , save it. each sub-report.

python - Keep newline characters from copy-pasting for JSON Validation -

problem : newline characters not kept html form after pasting. i'm developping app json format validation check. want paste json string in form, thave app check validity using json module python. should there error, function : json.loads(jsonstring) returns line, , column error occuring. need retrieve line , number. however, pasting in form doesn't keep newlines, hence on line 1 ... what shall pasting in form keeps newlines ? the answer question specify option "wrap=soft" in textarea tag. gives following : <textarea "wrap=soft"> text pasted after copied output of json validation function. \n newlines characters gonna seen after pasted in text field. </textarea>

Unit Test for readonly database -

we writing application accessing database of erp-solution. of course not allowed write database (database = readonly). this leads conflict when writing tests our daos access/read database. what best practices generate testdata? any suggestions appriciate, in advance tobi update: maybe important, don't map properties of tables in erp's database because won't need them. of not mapped columns not null. use non production database. if possible use in-memory database, use db unit create schema , standing data , let instance tear down when test pack complete.

php - Accessing deleted user's information -

i want keep track of user's information after have been deleted form database. there 2 reasons want this. firstly, after user deleted, want display message reading "$name has been deleted". secondly, want write name of deleted user log file. what have not work because when user deleted database, name becomes null (i using $_session variables). there way access information? what's cleverest way it? you put field db signify record "deleted", , appropriate filtering wherever attempt use records 'deleted=true' records not show up, e.g. @ login: select ... users (username = '...') , (password = '...') , (deleted = false) this way keep entire user record in database, it's not useable because it's been flagged deleted.

php - Creating a comments page selection using AJAX data -

i decided go ajax route heck of it, learn it, , see how worked. want add page selection comments exceed, say, 10 posts. i using codeigniter, , post have far: controller: public function updatefilters() { $this->blurb_model->create_session_filter($_post['filters']); $this->blurb_model->get_threads($_post['pagenum']); } model: public function get_threads($page = 0) { $needpagehere = $page [fetch threads] [return threads / count / etc] } so goal display number of pages user. part done. have submit button displayed each page based on total count of items returned in "get_threads" model (code omitted relevance sake). here ajax/javascript focus lies on updatefilter function. use returned thread list construct html , post within div. works fine. the problem want reuse updatefilters() function when user clicks on page button...but not working. want pas...

php - Using CDN with Image Resizer Script -

i'm using image resizer output images in website. possible use cdn in current situation? the image resizer takes file path of image , outputs desired image. if use cdn, image resizer script hosted on server. every image request going through server. using cdn benefit me in way? the cached object on cdns keyed on request uri, should benefit cdn provided application isn't generating randomness in urls. if image request looks this /resizer/200x100/thing.jpg # ...or... /resizer/thing.jpg?size=200x100 then cdn cache subsequent requests.

How to build Dynamic SSIS package? -

i’m new ssis package. i need execute same stored procedure available in several remote data bases , insert data main database in office. i’m trying create ssis package implement above requirement. (i used ole db source control , ole db destination control this) way hope increase number of remote data bases in future. there way process rather modify ssis package each time add new remote data base system? the ole db source control , ole db destination control use connection manager inform connection string, includes database name among other things. can make property variable using ssis configurations, package read xml file example. read config files, solve problem

Graceful Handling of Technical PHP/SQL errors -

i'm developing php web application heavy on database interactions. question is, how display "pretty" errors. i've got kinds of exceptions , not in pretty every aspect of app, still awkwardly post error text (which have working perfectly) either above half loaded page or on blank, white background. how go rerouting these generic error page has nice, contained spot inserting error message clients , testers can communicate me. my immediate guess post these errors, don't know how outside form less inside of function. you're using exceptions, that's good. you can prostpone output using output buffering control , , display errors condensed @ required area of page. the actual technique revolves around appending of errors $errors array , iterating through displaying nice errors along way.

sql server 2008 - Stored procedure return SELECT only with rows -

i set sql stored procedure return specific row in specific order (from more less important): -- 1st level -> query more detailed object... select ... -- if result find, sp returning correct row. -- if rowcount = 0 then, sp returning empty row -- , continues next query (less specific 1st one). if @@rowcount = 0 begin select .... else... -- again, if result exists, sp returns correct row, -- result of 1st query returned without rows... if @@rowcount = 0 begin select .... else again... end end is there option return select statement returns non empty row? don't want return empty rows... , each time row "sub-level" of 1st query, empty results before correct row. i thinking create table variable. there better ways? since looking lack of rows why not use if/else statement in procedure. like: if exists(/*firstquery*/ select ... something) begin select ... end else if exists (/*secondquery*/ select .... else... ) begin select .... else... ...

xcode won't build examples in Cocoa Programming 4th ed -

i'm getting errors , warnings seem indicate 4th edition examples meant osx 10.7 , xcode 4, i'm using osx 10.6 , xcode 3.2. i edited project settings set xcode 3.2 continue these errors when try build typing tutor. have no idea fixes. first try; presumably same types of errors occur when try other examples. how fix xcode settings of them? there errata file somewhere, include problems? nick errors , warnings: copy of "build failed" : check dependencies [warn]deployment target 10.7 architecture 'x86_64' , variant 'normal' greater maximum value 10.6 mac os x 10.6 sdk. error: unknown property attribute 'strong' @property (strong) nscolor *bgcolor; ^ warning: no 'assign', 'retain', or 'copy' attribute specified - 'assign' assumed @property (strong) nscolor *bgcolor; ^ warning: default property attribute 'assign' not appropriate non-gc object 2 warnings , 1 error generated. nnickk posts: 1 join...

sql - Moving a mysql database from one vps to another -

i'm moving large wordpress mysql db (1.49gb) old server new one, did to: mysqldump -u root -p dbname > public_location/db.sql then did a: wget http://oldserver/db.sql i created database on new server, created user, then: mysqldump -u root -p dbname < db.sql it says dump completed, why database on new server still empty? don't see tables @ all. rather call mysqldump on new server input file, call mysql mysql -u root -p dbname < db.sql you can, if brave , second vps has port 3306 open old 1 via tcp , have user account root@oldserver able write, in 1 action: # pipe dump directly old vps new vps: mysqldump -uroot -p dbname | mysql -h newserver -uroot -p dbname i wouldn't attempt on internet, i've done on lan several times. finally, don't forget --routines parameter if have stored functions , procedures need migrate database. won't go dump without it. mysqldump --routines -u root -p dbname > public_location/db.sql ...

cocos2d iphone - Objective-c Workaround for running intepretted code -

i'm used using eval() in languages javascript e.t.c. in cocos2d, select level, passing "1" or "2" loadlevel.m file, level classes named "levelone" , "leveltwo" accordingly, wanted create dictionary lookup paried "1" => "levelone" e.t.c run eval on string call [mylevel node]; apparently can't use eval in ios code, how go doing this? try using nsstringfromclass , nsclassfromstring functions. specifically, represent classes strings in dictionary, e.g., [mydictionary setobject:nsstringfromclass([levelone class]) forkey:@"1"] then, use right level dictionary, do: nsstring *levelasstring = [mydictionary objectforkey:@"1"]; id node = [nsclassfromstring(levelasstring) node] (i'm assuming +node class method) now, pretty uncommon , odd design in cocoa. perhaps if explain more you're doing, suggest alternate design choices might better.

winforms - How to switch Mainthread in C# Application -

how can separate thread? i used instance run loginform.cs firstly, so, first thread in app loginform.cs file,but don't want run loginform.cs's thread anymore, after login successfull, want app run main thread in maininterface.cs, meaning that, first thread run loginform.cs, stop thread on loginform.cs, after logined corrected, thread running in maininterface.cs. i follow below code, loginform.cs still main thread: maininterface.cs using system; public class maininterface : form { private static maininterface current; private maininterface () { if ( loginform.instance != null ) loginform.instance.close (); } public static maininterface instance { { if (current == null) { current = new maininterface (); } return current; } } } loginform.cs using system; public class loginform: form { private static loginform current; private loginform () { i...

excel vba - How to print or send braces ( ) using VBA sendkeys -

i have following code not sending braces. sendkeys "a=$(script.sh)",true but sending a=$script.sh braces missing. try this sendkeys "a=${(}script.sh{)}", true for example sub sample() dim retval retval = shell("notepad.exe ", 1) appactivate retval sendkeys "a=${(}script.sh{)}", true end sub output a=$(script.sh)

Facebook Picture to Google App Engine Application (Java) -

if users of appengine application can login using facebook account, possible transfer pictures of user facebook account appengine application? what steps in doing such thing? give me hints , references. thanks if can facebook id of user getting profile picture easy. https://graph.facebook.com/{id}/picture everything else requires auth_token. read more graph api , fql @ developers.facebook.com.

c# - Get entry from list by name -

i have list of forms: list<form> xxx = new list<form>(); how can find out whether contains form identified name, like: xxx.contains() try use findall function list<form> xxx = new list<form>(); int count = xxx.findall(x => x.name.equals("yourformname")).count();

utf 8 - understanding file encodings -

Image
in eclipse, have file place written: onclick='obj1.help_open_new_window(fn1(), "/redir/url_name")' and in eclipse edit menu->set encoding, see this: now change encoding utf-8 using same dialog box , text changes to: onclick='obj1.help_open_new_window(fn1(),�"/redir/url_name")' all know if not happening, website working fine. why happening , do prevent this? i have knowledge encodings: Â , nbsp mystery explained the absolute minimum every software developer absolutely, positively must know unicode , character sets (no excuses!) still not understand why happening. feel free go byte level(how file stored) explain it. update : here's understand: if file encoded in latin-1 every character byte , . should hex(32) . when convert utf-8, still remains hex(32) , . leads me believe in latin-1, not hex(32) combination of 2 bytes. how possible? the character have between comma , quote appear sto not normal space other wh...

apache - Moving Django site to another server- WSGIScriptAlias causing problems -

i'm in process of moving django site on new server. on old server, django site accessed mysite.com/ , now, access via mysite.com/mysite, , let mysite.com handle else. have made following changes apache so: wsgidaemonprocess mysite processes=2 threads=15 display-name=%{group} wsgiprocessgroup mysite wsgiscriptalias /mysite /srv/www/django.wsgi #wsgiscriptalias /mysite /srv/www/django.wsgi #previous config <directory /srv/www/mysite/mysite > order allow,deny allow </directory> alias /site_media "/srv/www/mysite/site_media/" alias /admin_media "/srv/www/mysite/admin_media/" this seems work fine- pointing browser @ mysite.com/unity/admin allows me access admin page correctly, , view respective apps correct. however, uses custom template seems half-baked. instance, there's entry in template below so: {% ifcodable cl.model %}<li><a href="/report/{{ app_label }}...

html - JavaScript to output form fields to a textarea ends with textarea being outputted but then immediately clearing itself? -

here's brief rundown of issue: i have javascript function gets value of bunch of form fields, combines them variable called outputarea, , use same function change value of textarea called "outputarea" value created outputarea in jscript (document.thisform.outputarea.value = outputarea). but when press "make notes" button calls function, grabs variables, hits alert dump variables make sure working, outputs form field want to... however, after function completes, clears itself. itself, mean whole form clears, including outputarea. i've checked source numerous times , there 0 references reset button or should clearing these values after function called, i'm @ loss. below function: <script type="text/javascript"> function getnotes() { var spoketo = document.thisform.spokewith.value; var problemwith = document.thisform.problemwith.value; var resolvedby = document.thisform.resolvedwith.value; va...

timing - iOS - Program method to execute specific code according to time on the phones clock -

is possible execute code when specific time reached on iphone's clock. able work after iphone closed (the screen goes black) app left running (the user did not return home screen). for example, possible method programmed go off @ 1:30:15 pm no relation current time, , there restrictions depending on whether phone closed or if app running in background? i found similar post here how generate event on specific time of clock in c#? generates timer based on current time run method later, instead of using clock without relation current time. i have created poor way of doing this- { time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); nslog(@"teststart - test start"); // check if(timeinfo->tm_hour == 12 && timeinfo->tm_min == 01 && timeinfo->tm_sec == 48) { nslog(@"run method"); printf("the time 12:01:48"); } else { nslog(@"else"); [self synct...

Convert XML to binary in Java -

i want convert xml binary data in java? fastest , easiest way this? is there internal java method can use? if want compress xml can read , use either gzipoutputstream or zipoutputstream described here .

Git recover stashed changes after merge --no-ff -

i use "git stash" , "git stash pop" save , restore changes in working tree. did , previous uncommitted changes gone. git stash -u git checkout master git pull --rebase git checkout dev git merge --no-ff master 10 files changed, 1000 insertions(+), 2000 deletions(-) git stash pop conflict (content): merge conflict in file.ext then thought revert merge, , did: git reset --hard origin/master git reset --hard origin/master now don't see of previous stashed uncommitted changes anywhere in file.ext , merged code. how can bring changes stashed? when pop off stash , removes stash well. stashed changes dumped working directory. then, when reset , reverted same changes. git reset --hard 1 of few dangerous "you-could-totally-lose-work-here" commands. this explains different aspects of reset well. to sum up, aren't in stash anymore, , reset working directory. lost ether of bits , bytes. though since changes once stashed, may ab...

javascript - how to check date can not be less than current date using jquery? -

i using jquery date picker in textbox , want user cannot select date less current. new jquery/javascript. please me. if mean want disable past dates then: $("#datepicker").datepicker({ mindate: 0 });

c++ - Calling functions through Iterator? -

in class faculty, have set of subjects. want go through set , on each subject call function adds student subject. here how function looks. void faculty::addstudent(student* n) { this->students.insert(n); set<subject*>::iterator it; for(it = this->subjects.begin(); != this->subjects.end(); it++) { (*it)->addstudent(n); } } the problem error: unhandled exception @ 0x01341c6d in university.exe: 0xc0000005: access violation reading location 0x1000694d. i using micorosft visual 2010. i new c++. i can provide other necessary information, don't know which. please tell me if needed. class student: public human { friend class university; friend class faculty; friend class subject; public: student(string name, string surname); ~student(); void index(int n); private: int index; }; in cases, such this, better practice using smart pointers instead of raw data pointers when data shared between 2 or...