[SOLVED]C some ugly code
#include <stdio.h>
#define N 4
void main(){
int a[][N] = {{2},{3,3,1},{1,8,8,2},{3,1}},*b = *a,*c = *(a+N-1),i,j;
while(b < c) *b++ += *c--;
for(i = N; i > 0;i--) printf("%d ",(*a)[i-1]);
Can somebody explain to me wtf is this? :v
is b type of ( int *b ) and i,j are ( int ), how this works?
Last edited by ZoLA (2015-04-30 14:59:46)
I expanded the code a bit:
#include <stdio.h>
#define N 4
void main(){
int a[][N] = {{2},{3,3,1},{1,8,8,2},{3,1}};
int * b = a[0];
int * c = a[3];
int i;
int j;
while(b < c) {
i = c[0];
c -= 1;
b[0] += i;
b += 1;
for(i = N; i > 0;i--) {
printf("%d ",a[0][i-1]);
Similar Messages
-
I am wondering if anyone would be so kind as to provide me with some example
code showing a class that outputs the following document:
<?xml version='1.0' encoding='utf-8'?>
<parameters>
<fileBoxInfo>
<filename>r:\files\practice\file.txt</filename>
<filename>r:\files\practice\file2.txt</filename>
<filename>r:\files\practice\file3.txt</filename>
</fileBoxInfo>
<reports>
<reportName>Report</reportName>
</reports>
</parameters>I mostly want to see the actual code to parse output the XML document, i am
a bit confused as to how this works. I did a search and many of the places I
found suggested outputing the XML document using write statements, and
building the XML lines using the String class i.e.=
"<" + tagName + ">" + value + "</" + tagName ">" ;
but I would rather learn the nitty-gritty stuff, as ugly as it very well may be.
Can anyone help me? this is NOT for homework, this is a project i am doing
at work where i have the opportunity to learn JAXP and JAXB.
I sincerely appreciate any help you give. Thanks in advance1. U need to have a XML schema defined first for ur XML
2. Download Java WebServices Developer Pack
3. use JAXB compiler to generate the binding code
4. Then u can use JAXBContext, Marshaller etc classes to output the below XML
YES, it is not as straight forward as we expect. -
I have a Sequence that launches a sequence in a New Thread that happens to launch some LabVIEW code. The problem is when the LabVIEW code finishes, it will not close even when the TestStand sequence terminates. Is there a way to tell this LabVIEW code to Exit, I've tried the Quit LabVIEW function, but that causes a C++ RunTime Error. The LabVIEW code does end though, and it is set in the VI properties to:
Checked - Show Front Panel When Called
Checked - Close Afterwardds if originally closed
The sequence call that the LabVIEW code is launched from has the following options:
- New Thread
Unchecked - Automatically wait for the thread to complete at the end of the current sequence
Unchecked - Initially Suspended
Unchecked - Use single threaded apartment
Any clues on this would be appreciated.Hi ADL,
Everything should close correctly if you check the checkbox "Automatically wait for the thread to complete at the end of the current sequence" in the thread settings.
With it unchecked, I am seeing the behavior you are.
Gavin Fox
Systems Software
National Instruments -
How to display some html code in the front panel
Hello.
I am trying to properly display a few lines of html code in some kind of indicator on my front panel.
I was trying to use an ActiveX container with MS IE in it, but all the methods I find are to make it navigate to a given URL. I did not find any method or property by which I could give it some html code and it would display it.
Anybody know of a way to do this? It does not have to be using ActiveX or MS IE.
Thanks in advance,
AlejandroHere is a simple way using the activeX that I have embedded in some programs in the past. You will have to call the file path to show the file.
Hope this helps some.
-Dave
Attachments:
HTML Window.vi 36 KB -
Display problem in some t code in SAP gui 710
Hello experts
we are using SAP gui 710,
some users facing display problem when they run some t code like CS11/MB51 etc.
the data grid show some rows in disordered manner, however if we download this into excel
its shows perfect data.
if user scroll the report as they appear than also many rows goes disturb.
i can't understand why this happen.
this is occurring on many front end system or on many tcods.
plz help me to resolve this.
Best Regards
Deepak SinghHi,
You can check the screen resolution of the user desktop. I feel this could be a reason.
Regards,
Deepak Kori -
I embedded some HTML code into adobe Muse but not displaying when the pages are Exporting to HTML
I embedded some HTML code into adobe Muse and when I published the remote site on business catalyst the (Add This widget) HTML code shows up but when I exported the site to HTML pages and view the index page in the browser (Safari, Chrome, Firefox) the (Add this widget) HTML code wouldn't display on any of the pages. I've used this code before on other Muse sites not sure what could have happened. Thnx!!!
Hi,
Please take a look at this post for a similar discussion : Re: When i export my muse website my youtube video links stop working. Why is this?
Regards,
Aish -
Since upgrading to Aperture 3.3, when I try to sync photos to my iPhone, I'm getting all versions in a stack loading onto my phone, which makes for some ugly pics, as well as taking up nearly double the space.
Could it be the problem lies with iTunes and not Aperture? iTunes 10.6.3 was released on the same day as Aperture 3.3 -- June 11.
If someone has a configuration to test an older version of Aperture with iTunes 10.6.3 to see if the problem exists, that could be helpful. -
Can u tell some source codes of java application
can u tell some source codes of java application?
i want to get some source codes .such as a proxy source code .
any help will be appreciated.hi
check www.rgagnon.com for more source code in java.
regards
Pradheep -
Auto closing of dispute cases--only for some company codes
Hi
We have activated dispute management for several company codes in our system. The auto closing of dispute cases also has been activated in status management. Cases are automatically closed by the system (through a batch job) when the last disputed object is cleared.
Now there is a requirement to deactivate auto closing only for some company codes. They want to close cases manually in these company codes.
Is this possible and if so how?
Regards
Raj.You cannot deselect at a company code level.
Can we go through you proposed process.
So you have a dispute for $100.
The customer pays it and the dispute closes.
Then the customer calls up and says they have an issue with the invoice they paid previously.
I have seen this happen before but there was a little twist
1 - The customer raised a debit note against the client for the issue that they had. The original invoice is cleared but a debit note is created and then disputed and processed. So you can close the original dispute and create a new dispute against the debit note
2 - The customer paid the wrong invoice. The dispute was closed. However to rectify the miss allocation the clearing document will be reversed meaning the dispute is "re-opened" and can be processed.
I am unaware of any other requirement for a customer to "re-dispute" a paid item in SAP. -
Hi, all transactions codes are saved in which table?some transaction codes?
hi,
all transactions codes are saved in which table?i want some transaction codes?All transaction codes are stored in table TSTC. Their texts are displayed in TSTCT.
Here are some T-CODE's..
OSS1 SAP Online Service System
OY19 Compare Tables
S001 ABAP Development Workbench
S002 System Administration.
SA38 Execute a program.
SCAT Computer Aided Test Tool
SCU0 Compare Tables
SE01 Old Transport & Corrections screen
SE09 Workbench Organizer
SE10 Customizing Organizer
SE10 Customizing organizer requests for user (To release for transport enter user name, press Enter. Select changed object and select ReleaseSE10 New Transport & Correction screen
SE11 ABAP/4 Dictionary Maintenance SE12 ABAP/4 Dictionary Display SE13 Maintain Technical Settings (Tables)
SE11 ABAP/4 Dictionary.
SE12 Dictionary: Initial Screen enter object name
SE13 Access tables in ABAP/4 Dictionary.
SE14 ABAP/4 Dictionary: Database Utility.
SE14 Utilities for Dictionary Tables
SE15 ABAP/4 Repository Information System
SE15 ABAP/4 Repository Information System.
SE16 Data Browser
SE16 Data Browser: Initial Screen.
SE16 Display table contents
SE17 General Table Display
SE30 ABAP/4 Runtime Analysis
SE30 ABAP/4 Runtime Analysis: Initial Screen.
SE30 Run Time Analysis (press Tips and Tricks button for good stuff)
SE32 ABAP/4 Text Element Maintenance
SE35 ABAP/4 Dialog Modules
SE36 ABAP/4: Logical Databases
SE37 ABAP/4 Function Library.
SE37 ABAP/4 Function Modules
SE38 ABAP Editor
SE38 ABAP/4 Editor.
SE38 ABAP/4 Program Development
SE39 Splitscreen Editor: Program Compare
SE41 Menu Painter
SE43 Maintain Area Menu
SE51 Screen Painter
SE51 Screen Painter: Initial Screen.
SE54 Generate View Maintenance Module
SE61 R/3 Documentation
SE62 Industry utilities
SE63 Translate Short/Long Text.
SE63 Translation
SE64 Terminology
SE65 R/3 documents. Short text statistics SE66 R/3 Documentation Statistics (Test!)
SE68 Translation Administration
SE71 SAPscript layout set
SE71 SAPscript Layouts Create/Change
SE72 SAPscript styles
SE73 SAPscript font maintenance (revised)
SE74 SAPscript format conversion
SE75 SAPscript Settings
SE76 SAPscript Translation Layout Sets
SE77 SAPscript Translation Styles
SE80 ABAP/4 Development Workbench
SE80 Repository Browser: Initial Screen.
SE81 SAP Application Hierarchy
SE82 Customer Application Hierarchy
SE84 ABAP/4 Repository Information System
SE85 ABAP/4 Dictionary Information System
SE86 ABAP/4 Repository Information System
SE87 Data Modeler Information System
SE88 Development Coordination Info System
SE91 Maintain Messages
SE92 Maintain system log messages
SE93 Maintain Transaction Codes
SE93 Maintain Transaction.
SEU Object Browser
SHD0 Transaction variant maintenance
SM04 Overview of Users (cancel/delete sessions)
SM04 Overview of Users.
SM12 Deletion of lock entries (in the event you have you are locked out).
SM12 Lock table entries (unlock locked tables)
SM21 View the system log, very useful when you get a short dump. Provides much more info than short dump
SM30 Maintain Table Views.
SM31 Table Maintenance
SM32 Table maintenance
SM35 View Batch Input Sessions
SM37 View background jobs
SM50 Process Overview.
SM51 Delete jobs from system (BDC)
SM62 Display/Maintain events in SAP, also use function BP_EVENT_RAISE
SMEN Display the menu path to get to a transaction
SMOD/CMOD Transactions for processing/editing/activating new customer enhancements.
SNRO Object browser for number range maintenance.
SPRO Start SAP IMG (Implementation Guide).
SQ00 ABAP/4 Query: Start Queries
SQ01 ABAP/4 Query: Maintain Queries
SQ02 ABAP/4 Query: Maintain Funct. Areas
SQ03 ABAP/4 Query: Maintain User Groups
SQ07 ABAP/4 Query: Language Comparison
ST05 Trace SQL Database Requests.
SU53 Display Authorization Values for User.
Human Resources
PA03 Change Payroll control record
PA20 Display PA Infotypes
PA30 Create/Change PA Infotypes
PP02 Quick Entry for PD object creation
PU00 Delete PA infotypes for an employee. Will not be able to delete an infotype if there is cluster data assigned to the employee.
Sales and Distribution (SD)
OLSD Config for SD. Use Tools-Data Transfer-Conditions to setup SAP supplied BDC to load pricing data
VA01 Create Sales/Returns Order Initial Screen
VB21 Transaction for Volume Lease Purchases (done as a sales deal)
VK15 Transaction used to enter multiple sales conditions (most will be entered here)
VL02 Deliveries
SAP Office
SO00 send a note through SAP, can be sent to Internet, X400, etc
Financial Accounting (FI)
FGRP Report Writer screen
FM12 View blocked documents by user
FST2 Insert language specific name for G/L account.
FST3 Display G/L account name.
KEA0 Maintain operating concern.
KEKE Activate CO-PA.
KEKK Assign operating concern.
KL04 Delete activity type.
KS04 Delete a cost centre.
KSH2 Change cost centre group delete.
OBR2 Deletion program for customers, vendors, G/L accounts.
OKC5 Cost element/cost element group deletion.
OKE1 Delete transaction data.
OKE2 Delete a profit centre.
OKI1 Determine Activity Number: Activity Types (Assignment of material number/service to activity type)
OMZ1 Definition of partner roles.
OMZ2 Language dependent key reassignment for partner roles.
Material Management (MM)
MM06 Flag material for deletion.
OLMS materials management configuration menu, most of the stuff under this menu is not under the implementation guide
MM configuration transactions
OLMB Inventory management/Physical Inventory
OLMD MM Consumption-Based Planning
OLME MM Purchasing
OLML Warehouse Management
OLMR Invoice Verification
OLMS Material Master data
OLMW MM Valuation/Account Assignment
Configuration related
OLE OLE demo transaction
OLI0 C Plant Maintenance Master Data
OLI1 Set Up INVCO for Material Movements
OLI8 Set Up SIS for Deliveries
OLIA C Maintenance Processing
OLIP C Plant Maintenance Planning
OLIQ New set-up of QM info system
OLIX Set Up Copying/Deleting of Versions
OLIY Set Up Deletion of SIS/Inter.Storage
OLIZ Stat Set Up INVCO: Invoice Verify
OLM2 Customizing: Volume-Based Rebates
OLMB C RM-MAT Inventory Management Menu
OLMD C RM-MAT MRP Menu
OLME C MM Menu: Purchasing
OLML C MM Menu for Warehouse Management
OLMR C RM-MAT Menu: Invoice Verification
OLMS C RM-MAT Master Data Menu
OLMW C RM-MAT Valuation/Acct. Asset. Menu
OLPA SOP Configuration
OLPE Sales order value
OLPF SPRO Start SAP IMG (Implementation Guide).
OLPK Customizing for capacity planning
OLPR Project System Options
OLPS Customizing Basic Data
OLPV Customizing: Std. Value Calculation
OLQB C QM QM in Procurement
OLQI Analysis OLVD C SD Shipping Menu
OLVF C SD Billing Menu
OLQM Customizing QM Quality Notifications
OLQS C QM Menu Basic Data
OLQW C QM Inspection Management
OLQZ Quality Certificates
OLS1 Customizing for Rebates
OLSD Customizing: SD
OLVA C SD Sales Menu
OLVS C SD Menu for Master Data
Regards,
Pavan -
Please send me some sample codes of ALVS using function modules only
Hi,
i am new to alvs
Please send me some sample codes of alvs using function modules only.
My mail id is [email protected]
Thanks & regards,
hari priyahI
http://www.sapdev.co.uk/reporting/reportinghome.htm SPECIAL FOR ALL ALV PROGRAMS WITH EXAMPLE CODES
Check the below links :
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
http://www.sap-img.com/abap-function.htm
http://www.sap-basis-abap.com/sapab034.htm
http://www.erpgenie.com/abap/example_code.htm
These all are very simple ALV programs ,good luck
<b>Reward if usefull</b> -
Kindly write some sample code for this scenario
Kindly write some sample code for the below Logic.
For a set of Deliveries entered on the selection screen get the relevant data from LIKP & LIPS.
for all the deliveries selected get the sales order data from VBAK & VBAP based on the VGBEL & VGPOS in LIPS.
The Output internal table should contain only deliveries which are created with reference to a sales order.
Thanx in Advance.
Akshitha.Hi,
Select avbeln bposnr bmatnr blfimg bvgbel bvgpos into table ITAB
from likp as a join lips as b on Avbeln = bvbeln
where a~vbeln in s_vbeln..
if not itab[] is initial.
select avbeln bposnr b~matnr ... into table itab1 from vbak as a join vbap as b
on avbeln = bvbeln
for all entries in itab where avbeln = itab-vgbel and bposnr = itab-vgpos.
endif.
loop at itab.
read table itab1 with key vbeln = itab-vgbel posnr = itab-vgpos.
if sy-subrc <> 0.
delete itab index sy-tabix.
endif.
endloop.
Now ITAB will have only deliveries created against Sales orders.
reward points if useful
regards,
Anji -
I want to skip some html code part when refersh the page, how can we know
Hi,
i want to skip some html code part when refersh the page, how can we know when we pressed refresh button or F5 key
thanks in advance....There's not really any simple way to do this. Maybe tracking the page the user should be one from every page in the site and if the page being accessed is the same as the last one accessed, assume it was a refresh.
-
When using 6.0 beta and 7.0 beta on my MacBookPro, I am (too) frequently asked for my master password. This doesn't occur in other programs. Do I have some evil code in my Firefox program?
Why I'm asked for my Master Password seems troublesome.Hello Matt, fellow archaeologist :)
Security updates are essential on any and all software, specially your browser. Mozilla is working to streamline the updating process as much as possible, but you shouldn't neglect your own security for a few seconds of "wasted" time.
I hope you do the best for yourself. -
Hi,
someone can send me some sample code showing the use of lock functions before updating any tables..i need the full code ..
pls help me
points will be rewarded
raviRavi,
I have one simple example and it will show what is lock objects exactly.
See the program :
*& Report ZTEST_LOCK1
REPORT ZTEST_LOCK1.
data i_plaf like plaf occurs 0 with header line.
start-of-selection.
select * from plaf into table i_plaf
where plnum = '0000005432'.
loop at i_plaf.
CALL FUNCTION 'ENQUEUE_EMPLAFE'
EXPORTING
MODE_PLAF = 'E'
MANDT = SY-MANDT
PLNUM = i_plaf-plnum
X_PLNUM = ' '
_SCOPE = '3'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
break sy-uname.
CALL FUNCTION 'LOESCHEN_PLANAUFTRAG'
EXPORTING
ECM61M =
ECM61W =
EPLAF = I_plaf
MONTX =
MDVL_FLAG = XFLAG
RM_CONF = ' '
APO_PROC = ' '
EMT61D =
ECM61B =
USE_COLLECTIVE_UPDATE = ' '
LAST_ORDER = ' '
TABLES
MDSBX =
MDPMZ =
EXCEPTIONS
UNDEFINED_INTERFACE = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'DEQUEUE_EMPLAFE'
EXPORTING
MODE_PLAF = 'E'
MANDT = SY-MANDT
PLNUM =
X_PLNUM = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
endloop.
Ravi, Goto se11 ,use PLAF Table -> get one number from PLNUM field.
keep the Plnum field in where clause in select query.
now run the program ,already i setup break point after lock of planned order.
once you are in debugging,then use MD12 Transaction ( Change Planned order),enter planned order number(what ever you use number in the program,use same number in MD12 Transaction)-> and see the results.
you get message planned order number locked.
basically the program does it deletes the planned order ,before deleteing i am just locking planned order number.
do not use this program anywhere except dev system.
Thanks
Seshu
Maybe you are looking for
-
Showing prompt value in report - Need Urgent help
Hi All, I have created a query that has a prompt (it is not the dashboard prompt) that has " in Between" operator. It is on date column. When i am generating report by passing the prompt value the data is coming properly. I have downloaded the report
-
Using LOV with Validation on the Numeric Fields results in Error
Dear JHeadstart Team, During my work with lov I encountered another problem. I defined a lov and attached the lov to a numeric field and check the LOV for validation. Now when I use LOV using the LOV button it works fine but when I enter some numbers
-
Which to buy airport express or extreme
I want to go wireless for my mac mini as well as use it to stream videos to my TV, use it for wireless printing and with my two iphones. Security is #1 however speed to almost of equal importance. I have my internet connection thru my cable company a
-
Any way to fix NetStream.Play.FileStructureInvalid?
I have an FLV that plays back fine as an advertisement in brightcove's player, but fails with the error NetStream.Play.FileStructureInvalid in my custom Flash9-based player based on the Open Video Player framework. Is there any way I can "fix" this F
-
Can iTunes change DVD's into a .mov format ?
So can iTunes change the format of a DVD into the format it needs to be put onto the video iPod cause this kid at my school says you can...But I put a DVD in and tried to import it and everything and nothing happened so am I doing something wrong or