Posts

sql - Oracle - Convert a String (containing a date) into a String (another date's format) -

i have oracle database contains table have column (string) contains dates (in java code, tostring() of date inserted string column) , format example : fri feb 28 00:00:00 cet 2014 so need fix have standard format => instead of "fri feb 28 00:00:00 cet 2014" i'll have "2014-02-28 00:00:00.0" for future insertions in database, problem fixed => usage of dataformat instead of tostring() on date. but ! problem how convert entries in database ! i'd add not possible change type of column date must remain string. any ideas ?? you need first convert timezone , reconvert string of required format. here query. select to_char(to_timestamp_tz('fri feb 28 00:00:00 cet 2014', 'dy mon dd hh24:mi:ss tzd yyyy'), 'yyyy-mm-dd hh24:mi:ss') || '.0' dual; to_char(to_timestamp_ --------------------- 2014-02-28 00:00:00.0

ios - Set integer 'variable' using result of NSString -

this question has answer here: swift: converting string variable name 1 answer i'm using single action handle 10 uiswitches sending tag value it. have number of integers initialised when launched thus; int switch_1 = 0; int switch_2 = 0; etc when particular switch switched on, want set integer corresponding integer 'variable' 1 so, if switch 2 tag 2 turned on, puts '1' in corresponding int 'switch_2' integer. i getting string right name via 'stringwithformat' appending tag value don't know how write 1 corresponding integer variable it. any appreciated. essentially, want write integer 'variable' name same name generated string value. thanks you can use array each index represents switch, following: int swticharray[10] = {0}; // if have 10 switches while in action handling action of multiple butto...

c# - Sending email through asp.net -

this design page : <%@ page language="c#" autoeventwireup="true" codefile="register.aspx.cs" inherits="register" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <table style="border:1px solid" align="center"> <tr><td>username:</td><td><asp:textbox runat="server" id="txtusername"></td></tr> <tr><td>password:</td><td><asp:textbox runat="server" id="txtpassword" textmode="password"></td></tr> <tr><td valign="top...

c# - Code runs but doesn't update database -

this code supposed save values in textboxes specific row. code runs fine no hiccups, refuses update database no matter do. try { using (var con = new oledbconnection()) { con.connectionstring = @"provider=microsoft.ace.oledb.12.0;data source=c:\users\user\desktop\esoft\gym\gym\bin\debug\clients.accdb;"; con.open(); using (var com = new oledbcommand()) { com.connection = con; com.commandtext = "update gym set bmi = @bmi , health = @health , weight_change_to_healthy_bmi = @weight id = @id"; com.parameters.addwithvalue("@bmi", bmi.text); com.parameters.addwithvalue("@health", health.text); com.parameters.addwithvalue("@weight", change.text); com.parameters.addwithvalue("@id", id.text); com.executenonquery(); } } messagebox.show("saved"); } catch (exception ex) ...

python - django static files - don't work -

i have django project , i'm using static files, didn't work , can not include css file or image html file here <link rel="icon" href={% static "img/favicon.png" %}> or <link href={% static "css/mine.css" %} rel="stylesheet"> i checked direction , ok cant understand why code didn't work i add static section in settings.py follows static_url = '/static/' just change this <link rel="icon" href="{% static "img/favicon.png" %}"> and <link href="{% static "css/mine.css" %}" rel="stylesheet">

python - Running spark-submit from pycharm -

i trying figure out how develop apache-spark program in pycharm. have followed article in link . define spark_home , add pyspark python path well. there no error in importing pyspark modules , autocomplete works fine. however error on defining sparkcontext when run program in pycharm. error: must specify primary resource (jar or python or r file) run --help usage or --verbose debug output ... ... exception: java gateway process exited before sending driver port number i managed run program on terminal submit-spark. need change configuration on pycharm or there anyway run submit-spark instead of python in pycharm? if fine terminal submit-spark can add run configuration you. otherwise can see configuration in edit run/debug configurations window well. this post in particular can there.

Permissions when iterating over files in directory Unix TCSH scripting -

i'm writing script print file names of every file in subdirectory of home directory. code is: foreach file (`~/.garbage`) echo "$file" end when try run script, following error: home/.garbage: permission denied. i've tried setting permissions 755 .garbage directory , script, can't on error. there i'm doing incorrectly? it's tcsh script. why not use ls ~/.garbage or if want each file on separate line, ls -1 ~/.garbage