Posts

Showing posts from May, 2011

ssl - Can not log in to Drupal 7 admin after changing to HTTPS. Access Denied and cookie not set -

i can no longer log drupal 7's admin area after adding ssl certificate , forcing https in url. the website served via http protocol , worked fine. mention if revert http mode, site work expected. however, trying implement https. additionally, while logging in, have noticed cookie response sent server deleted leading access denied message. so far, after going through mixed response in internet, have played around session.cookie, $base_url , $cookie_domain variables within settings.php file. haven't found solution yet. has bumped problem? response highly appreciated. disable in .httaccess rewritecond %{https} off [or] rewritecond %{http_host} ^www\.example\.com* rewriterule ^(.*)$ https://example.com/$1 [l,r=301]

java - Are there any reasons why some methods in File uses boolean values to indicate its success (instead of just throwing exceptions)? -

the file class in java contain methods utilize boolean values indicate successfulness of operation being carried out. users of said methods required check return value every time being called. below snippet of documentations taken mkdir() stating requirement: public boolean mkdir() creates directory named file, assuming parents exist. use mkdirs if want create missing parents. note method not throw ioexception on failure. callers must check return value. there's case createnewfile() (even weirder) use both boolean values thrown exceptions indicate successfulness: public boolean createnewfile() throws ioexception creates new, empty file on file system according path information stored in file. this method returns true if creates file, false if file existed. note returns false if file not file (because it's directory, say). ... note method not throw ioexception if file exists, if it's not regular file. callers

javascript - How to set the width of the image in the following case? -

i have image, want set width in javascript. it written in following format, how set width? create("td",{colspan:"4",innerhtml:"<img src='" + imagepath + "images/categorieslogos.jpg'> style= 'width:900px'"},"space1"); here imgepath variable. picks image, how assign width? tried use style way shown in code. the inline style tag outside of img tag. try this: create("td",{colspan:"4",innerhtml:"<img src='" + imagepath + "images/categorieslogos.jpg' style= 'width:900px'>"},"space1");

chronometer - Choronometer to save elapsed time and display in the ListView in android -

i have choronometer in app. working fine unable save recorded time. every time user clicks on stop button want capture time , save in database , display user in listview past recorded time. have have tried implement same theres error in code because app crashes when stopbutton clicked. pls can me out code have written follows: studytimerecord: @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { final view rootview = inflater.inflate(r.layout.fragment_studytimerecord, container, false); bundle bundle = getarguments(); mchaptername = bundle.getstring("chapter_name"); startbutton = (button) rootview.findviewbyid(r.id.start_button); stopbutton = (button) rootview.findviewbyid(r.id.stop_button); resetbutton = (button) rootview.findviewbyid(r.id.reset_button); studywatch = (chronometer) rootview.findviewbyid(r.id.chronometer);

List of rotation matrix for object projection on screen in android -

i have vector x , y gps latitude , longitude of device position , target object. draw marker on target object on screen need transformation vector. transform need use rotation matrices. have created list of rotation matrices. point not being drawn on correct position. think m missing rotation matrices. below list rotation being landscape x axis -90 degree remap coordinate after getting rotation getrotation() method my point being shown left of main object. y axis guess. projection correct that's taken opengl. think missing rotation y axis. please help. yes missing rotation y-axis. error magnetic north not being same true north. magnetic north moving nw @ speed of 40km/year true north. result need calculate deflection of magnetic sensor north @ position true north. problem deflection different @ different position , different time. android gives method calculate deflection @ position given latitude,longitude , current time. method getdeclination () , use belo

jersey - Exception mapper isn't being called -

here exception mapper @provider class jsonparseexceptionmapper implements exceptionmapper<jsonparseexception> { @override public response toresponse(final jsonparseexception jpe) { return response.status(status.bad_request) .entity("invalid data supplied request").build(); } } but i'm not able capture parser error. i'm using jersey 1.16 my service @consumes({ mediatype.application_json }) public response createusers(arraylist<user> users) {.... it exception mapper not added set of classes of application instance.

postgresql - SublimeRepl New Repl "No Repl for 'sql' " -

i'm trying set sublime text repl postgres using sublime repl. i've set new folder in users/packages/sublimerepl/config called postgres , added 2 files: main.sublime-menu has following content [ { "id": "tools", "children": [{ "caption": "sublimerepl", "mnemonic": "r", "id": "sublimerepl", "children": [ {"command": "repl_open", "caption": "psql", "id": "repl_psql", "mnemonic": "q", "args": { "type": "subprocess", "encoding": {"windows": "$win_cmd_encoding", "linux": "utf-8&

Django stringformat i -

i have dropdown list on page. when user selects value, index of option stored in database. when user retrieves page, previous stored value should selected default. this how render selected option in template: {% if report.tag == forloop.counter|stringformat:"i" %} selected="selected" {% endif %} the loop contains list of values, report.tag contains value selected user. my question is: when comparing values in template have use forloop.counter|stringformat:"i" . if forloop.counter used, comparison not work. why that? // if never registers, though foorloop.counter // outputs same value forloop.counter|stringformat:"i" {% if report.tag == forloop.counter %}

javascript - Git Diff with data on the command line -

Image
i'm creating ide typescript http://alm.tools/ . i'd git diff gutter , have working: however based on running git diff on saved file ( git diff -u0 path/to/the/file ) (and in fact i forced save file if isn't saved ) i'd diff head version of file file have in ide memory , not yet commited disk. from https://git-scm.com/docs/git-diff can't find way. in git cant it. why? you need understand how git diff works. in short (the commands explain not executed in the same order explained here, made more simple understand process): when execute git diff git making list of known files. compare file ones on working directory (in real life executing several diff commands un-tracked, modified , deleted) , list of modification see. same process apply staging area well. since git has process physical files (you can read full code here: ( https://github.com/git/git/blob/master/diff.c ) cannot use must have file. what can overkill in opinion simul

java - Jar is perfectly running when run via UNIX Script, but gives Null pointer when run via Crons -

i facing strange issue , able run jar fine when directly running through unix script, when same unix script triggered via crons gives me error. my unix scirpt : myunix.ksh /path/to/java -jar /some/path/to/myjar.jar runtimeargumentpathtomypropertyfile the above code if run via unix command : bash /path/to/my/script/myunix.ksh runs fine. but when trigger script via crons ex : 9 10 * * * bash /path/to/my/script/myunix.ksh gives me null pointer exception. my code use property file load configurable items, path pass run time argument. the line gives me null pointer exception code access property file values. its gives me no file not found exception. seems code has found file , loaded too. upon debugging found property object has no key value pairs when run via crons. have checked permission of files involved in process 0777. still not got solution. here code used load properties file : /** * used initialise pm repository * @param keynotcasesensitive * @param abso

c# - Entity Framework 6 - Code first - FK is generated in inherited classes but relation is defined in base class -

what want have base class , 2 separate lists of inherited classes. model: public class instance { public int instanceid { get; set; } public virtual icollection<user> users { get; internal set; } public virtual icollection<masteruser> masterusers { get; internal set; } } public abstract class coreuser { [key] public int userid { get; set; } public int instanceid { get; set; } public virtual instance instance { get; set; } } [table("users")] public class user : coreuser { public string username { get; set; } } [table("masterusers")] public class masteruser : coreuser { public string masterusername { get; set; } } this dbcontext: public class mycontext : dbcontext { public dbset<user> users { get; set; } public dbset<masteruser> masterusers { get; set; } public dbset<instance> instances { get; set; } } this create 4 tables tpt inheritance model fine. problem users , masterus

java - Not able to search the email server with searchTerm using Mail API -

an email sent lets gg@gg.com attachment 2 email id's .one, email id , xx@xx.com got email. when did mail search using java mail api email id search criteria , not able find though received email.but when forward same email id's search criteria working fine. please let me know when email received first time @ point why not able search properties properties = system.getproperties(); properties.put("mail.smtp.host", exchangeproperties.getsmtphost()); properties.put("mail.pop3.connectiontimeout", string.valueof(exchangeproperties.getpop3connectiontimeout() * 1000)); properties.put("mail.pop3.timeout", string.valueof(exchangeproperties.getpop3timeout() * 1000)); session = session.getinstance(properties, null); session.setdebug(logger.isdebugenabled()); // store store = session.getstore("pop3"); store.connect(exchangeproperties.getsmtphost(), user, password); folder folder

java - How to Prevent Spring AMQP from Blocking on Unacked Messages? -

i have @rabbitlistener annotated method spring amqp blocks after returning method. underlying simplerabbitlistenercontainerfactory uses acknowledgemode.manual . don’t want acknowledge message in listener method, yet. is there way not have spring amqp block in such scenario? in more detail i use listener this: @rabbitlistener(queues = "#{ @myqueue }") void recordrequestsfrommymessages( @payload mymessage mymessagepayload, @header(amqpheaders.delivery_tag) long deliverytag, channel channel) { // record relevant parts of given message , combine them // parts previous/future messages // don't acknowledge consumed message, yet; instead keep // record of channel , delivery tag } since batch/combine multiple messages before process them (asynchronously) later, don’t want acknowledge consumed message right away. instead, want once messages have been processed later. with current approach, spring amqp blocks after returnin

android - Content area defined in 9 patch image doesn't work for custom view -

Image
currently, have custom view barchart . wish have red shadowing effect on it. i'm using 9 patch image technique achieve so. <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:minheight="240dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/card_background_red" android:orientation="vertical" android:padding="0dp" > <org.yccheok.jstock.gui.charting.barchart android:id="@+id/bar_chart" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" /> </linearlayout> in custom view, there line of code, draw string @ end-y of view. // drawing string @ end-y of barchart custom view. canvas.drawtext("2007", x

c++ - How to set progress bar for parallel_invoke? -

what want how progress data. can implement bar whatever like. , i'm using visual c++ 2010, can use mfc. now, i'm writting multithreaded program. , microsoft provides ppl lib since vc++ 2010. parallel patterns library (ppl) provides algorithms concurrently perform work on collections of data. it's convenient implement multithreaded app, encounter progress bar problem. how can set progress bar parallel_invoke? the demo code follows: // parallel-invoke-structure.cpp // compile with: /ehsc #include <ppl.h> #include <string> #include <iostream> using namespace concurrency; using namespace std; // returns result of adding value itself. template <typename t> t twice(const t& t) { return t + t; } int wmain() { // define several values. int n = 54; double d = 5.6; wstring s = l"hello"; // call twice function on each value concurrently. parallel_invoke( [&n] { n = twice(n); }, [&d] { d =

bigdata - What is the under the hood database in cloudera 5.x -

is there under hood database in cloudera 5.x distribution have db2 in ibm distribution i.e. under biginsights. the need have small tables part of our project along huge tables , in hive taking more time fetch data small tables compare rdbms. if have rdbms under hood in cloudera 5.x can create small tables in database. hopefully i'm understanding question properly. cloudera manager , cloudera cdh components rely on database metadata , other bits of application data. default, when install cloudera manager , cdh use embedded postgres database. can change , applications use either postgresql, oracle or mysql. for example hive stores metadata "tables" , "databases" create in default database or database selected "hive metastore database type" in cloudera manager. hope helps.

php - .htaccess Rewrite problems -

either need go school desk, or there weird going on. the following doesn't work, real physical files , directories not resolve: <ifmodule mod_rewrite.c> options +followsymlinks rewriteengine on rewritebase / rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} !-l # following rule must not affect real physical files, rewriterule ^(img/.*)$ http://old.site.com/$1 [l,r=301] rewriterule .* index.php [l] </ifmodule> however piece of code works , resolves real files , folders fine: <ifmodule mod_rewrite.c> options +followsymlinks rewriteengine on rewritebase / rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} !-l rewriterule ^(img/.*)$ http://old.site.com/$1 [l,r=301] rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} !-l rewriterule .* index.php [l] </if

JavaFX scene builder questions -

i'm working javafx scene builder , have 2 questions. fisrt one:"how add border pane in javafx scene builder?" second one: "how split cells in hbox?" i dont know why want join hbox cells can set resize behaviour every child of hbox. there example in hbox's javadoc : //for example, if hbox needs textfield allocated space: hbox hbox = new hbox(); textfield field = new textfield(); hbox.sethgrow(field, priority.always); hbox.getchildren().addall(new label("search:"), field, new button("go")); joining cells possible in gridpane row- and/or columnspan. gridpane gridpane = new gridpane(); gridpane.add(new button(), 0, 0, 2, 2); // column=0 row=0, spans on 2 columns , 2 rows gridpane.add(new label(), 3, 1); // column=3 row=1 (spans on 1 column , 1 row (default)) row-/columnspan , vertical horizontal grow can specified in properties bar of scene builder, residing on right side, default.

android - Hide soft keyboard on pressing back -

i have edittext in activity , want active , soft-keyboard open when open activity . here xml edittext : <edittext android:background="@null" android:cursorvisible="true" android:eleganttextheight="true" android:enabled="true" android:focusable="true" android:hint="search" android:id="@+id/edittext11" android:inputtype="textnosuggestions|textcapsentences" android:layout_centervertical="true" android:layout_height="wrap_content" android:layout_width="match_parent" android:singleline="true" android:textcolor="#000000" android:textcursordrawable="@null" /> and have used android:windowsoftinputmode="statevisible" activity in have edittext . the problem is, when press back once, keyboard not hide(ideally in other edittext s) , when press back again, closes activity .

ios - UINavigationBar: wrong animation with AutoLayout if BackgroundImage is set -

i have uinavigationcontroller within container. container has leading-constraint. want animate leading-constraint shrink navigationcontroller-view display additional stuff. this working fine long backgroundimage not set. if set custom backgroundimage uiappearance, navigationbar doesn't animate size-change backgroundimage. ios7 working fine. how can fix ios6? project: https://bitbucket.org/arturfriesen/navigationbartest

android - I can't access SDK Tools tab in settings -

i'm on latest android studio 2.1, installed on existing sdk, when go settings/appearance & behaviour/system settings/android sdk can see detects installed sdk although warning of whitespace path, sdk tools , sdk update sites tabs greyed out think, can't access them. on that? are using window's enable show hidden files in control panel/appearance , personalisation/file explore options? double click on it, , go view , check mark , hit apply. you find hidden folder sdk in file explorer c:\users\"your administrator name"\appdata\local\android\sdk . copy files here c:\android\sdk , restart android studio, , enjoy.

expandablelistview - Android how to init child and parent data for expandable listview -

greetings everyone. developing app want implement dynamic expandablelistview . clientfunction.java public class clientfunction extends appcompatactivity { string id, name, mo, city, pin, date, profmail; sessionmanager session; arraylist<hashmap<string, string>> arraylist; listview orderlist; orderlistadapter adapter; string amount, status; textview amt; linearlayout orderempty; dialog dialog; list<string> listdataheader; hashmap<string, list<string>> listdatachild; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_client_function); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); final actionbar ab = getsupportactionbar(); assert ab != null; ab.setdisplayhomeasupenabled(true); ab.settitle("orders");

Accessing a function against another owner in oracle? -

i having function called fn_export , owner bhist. calling function ohist user using bhist.fn_export. while calling facing below issue. ora-00942: table or view not exist ora-06512: @ "bhist.fn_export", line 442 ora-06512: @ line 20 i tried verify tables in function , able access tables ohist. have execute grant on bhist.fn_export ohist. still having issue. can 1 of please in resolving issue? thanks, venkat you need grant execute privilege on function ohist user. syntax is: grant execute on function_name username; you can connect bhist user , grant privilege using: grant execute on fn_export ohist; you can connect sys or system, , use command: grant execute on bhist.fn_export ohist; see below simple example (one user named test , other named dev ): sql> connect test enter password: connected. sql> create function fn_export return number 2 begin 3 return 20; 4 end; 5 / function created. sql> connect dev enter passwo

jQuery - Validate that two different <li>'s has been selected -

Image
for online booking system have user put in pickup , destination postcode. problem user can search address, e.g. 'le115gu' , show multiple results. @ moment user can go next page of booking form without selecting address doesn't write address database. need put validation in there if user doesn't select li-addr-res either pickup or destination, prompted alert. this happens if user searches postcode:- so like:- if(nextpgenum == 2) { // code // if title="dropoff" , no li-addr-res selected // or if title="pickup" , no li-addr-res selected // alert("you must select pickup or dropoff address") } i'm not sure how can achieve appreciated. here html code dropoff. <div id="cp-row-wrapper-dp" class="row-wrapper row-wrapper-addr-search" title="dropoff"> <div class="div-search-label left"> <p class="a-topheader-infotext"> <strong>

javascript - binding multi dropdown list in knockout.js -

i have multi dropdown list , need following: 1. make sure when selecting value in 1 dropdown list won't appear in others (couldn't find proper solution here). 2. when selecting value "text" text field ( <input> ) apear instead of yes/no dropdown. 3. "choose option" appear first row (still working on it). 4. make sure if "text" selected, on top (still working on it). jsfiddle html : <div class='liveexample'> <table width='100%'> <tbody data-bind='foreach: lines'> <tr> <td> choose option: </td> <td> <select data-bind='options: filters, optionstext: "name", value: filtervalue'> </select> </td> <td data-bind="w

php - How a chosen multiselect can be validated with JsValidator in Laravel 5 -

i using chosen convert simple select in multiselect here... <div class="form-group"> {!! form::label('media_formats', trans('medias::messages.valid_formats'), ['class' => 'control-label']) !!} {!! form::select('media_formats[]', $media_formats, null, ['class' => 'form-control', 'id' => 'media_formats', 'multiple', 'data-chosen']) !!} </div> trying validate media_format element has been selected using jsvalidator package... {!! jsvalidator::formrequest('maravel\media\http\requests\admin\mediaresourcecreaterequest', '#create-edit-form' ) !!} and finally, using following rule @ request class... public function rules() { return [ ... 'media_formats' => 'required', ]; } the laravel validation bag of errors returns media format error, not being printed anywhere. why? has fact chosen hides select ele

git - Svn2git Migration: Repository/Project Complication -

i have 3 svn repositories, each having 30~ projects in them. want convert these 3 svn repositories git repositories, respective projects kept inside. give clear idea, representation of structure have: -repository1 -- project1 -- project2 -- project3 -- project4 -- project5 -repository2 -- project1 -- project2 -- project3 -- project4 -- project5 -repository3 -- project1 -- project2 -- project3 -- project4 -- project5 i tried lot of tutorials far, none worked purpose. of tutorials suggest create repository per project, find not-okay, not pattern have svn. when execute command this: svn2git http://address/address/repository1/project1 --authors ../authormap.txt --metadata it creates folder of project git repository, don't want; because not case svn structure. so need command converts entire repository (along 30 projects in it) git repository. told remove projectname @ end of address, this: svn2git http://address/address/repository1 --aut

how to get android default font list programmatically? -

Image
i trying create app provide text formatting (like font style , font size , font color). want default fonts provided android list shown in drop-down. selecting font drop-down change text dynamically. can , how can achieve either via xml or programmatically ? see image how must like there 3 system wide fonts in android sdk. normal serif monospace more info : click here

android - Libgdx: screen managaer -

good day sirs, i've started develop game uses lot of screens(introscreen,splashscreen,previewscreen,mainmenuscreen, etc.) , have encountered of following problem: switching screen other screen unresponsive or buggy, , repeats same screen on , on again. have recycled button planned on using in different windows, visible in 1 of windows in other. implements screens screens, have abstract screen class because have seen in different sample codes extend screen class implements screen. i'm quite confuse part, hope find proper solution problem. is there way navigate or make more responsive screens?would improve performance of game create screenmanager?what instances should screenmanager have? this code mainmenuscreen encounters problem button. public class mainmenuscreen implements screen { public static final string log = "mainmenu class"; private orthographiccamera camera; private spritebatch batch; private texture texture = assets.bgmenu; private sprite spr